PHPackages                             ojezu/add-call-to-remote-service-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ojezu/add-call-to-remote-service-bundle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ojezu/add-call-to-remote-service-bundle
=======================================

Symfony2 bundle that allows injecting method from one service declaration in DI to another

v1.1.0(8y ago)27.6kMITPHP

Since Mar 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/OJezu/add-call-to-remote-service-bundle)[ Packagist](https://packagist.org/packages/ojezu/add-call-to-remote-service-bundle)[ RSS](/packages/ojezu-add-call-to-remote-service-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

OJezu/AddCallToRemoteServiceBundle
==================================

[](#ojezuaddcalltoremoteservicebundle)

This bundle allows adding calls in container to other services, as though they were declared there. Allows some decoupling - the hottest thing in OOP.

Symfony 3.4 and 4.0 Note
------------------------

[](#symfony-34-and-40-note)

As of version 3.4 and 4.0 of Symfony, Dependency Injector is able to find all tagged services on its own:
[http://symfony.com/doc/current/service\_container/tags.html#reference-tagged-services](http://symfony.com/doc/current/service_container/tags.html#reference-tagged-services)

This Bundle still works, and can be useful in some cases, e.g. when it's impossible to overwrite or modify declaration of the "parent" class.

Installation
------------

[](#installation)

```
composer require ojezu/add-call-to-remote-service-bundle
```

Usage
-----

[](#usage)

Register this bundle in app/appKernel.php:

```
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new OJezu\ConfigurableDiscriminationBundle\AddCallToRemoteServiceBundle(),
            // app bundles
            new Acme\TestBundle\ParentBundle(),
            new Acme\TestBundle\ChildABundle(),
            new Acme\TestBundle\ChildBBundle(),
        );
        return $bundles;
    }
}
```

Now, instead of:

```
services:
    acme.root_service:
        class: Acme\Services\RootService
        calls:
            - ['registerChildService', ['Foo', '@acme.children.foo']]
            - ['registerChildService', ['Bar', '@acme.children.bar', {'foo': 'bar'}]]

    acme.children.foo:
        class: Acme\Services\Children\FooService

    acme.children.bar:
        class: Acme\Services\Children\BarService
```

You can do this!

```
services:
    acme.root_service:
        class: Acme\Services\RootService
```

```
services:
    acme.children.foo:
        class: Acme\Services\Children\FooService
        public: false
        tags:
          - name: 'ojezu.add_call_to_remote_service'
            remote_service: '@acme.root_service'
            method: 'registerChildService'
            argument.0: 'Foo'
            argument.1: '@'
            argument.2.foo: 'bar'
```

```
services:
    acme.children.bar:
        class: Acme\Services\Children\BarService
        public: false
        tags:
          - name: 'ojezu.add_call_to_remote_service'
            remote_service: '@acme.root_service'
            method: 'registerChildService'
            argument.0: 'Bar'
            argument.1: '@'
```

`'@'` will resolve to `acme.children.foo` and `acme.children.bar` respectively!

Questions
---------

[](#questions)

##### Why `argument.0`, `argument.1`, `argument.2.foo` and not an array?

[](#why-argument0-argument1-argument2foo-and-not-an-array)

Symfony/DependencyInjector does not support that. All tag attributes must be scalars, because of XML format supported and used internally by DependencyInjector.

##### Will this load my services when they are unneeded?

[](#will-this-load-my-services-when-they-are-unneeded)

No! This bundle modifies only definitions of services in container, it does not need to (and does not) load referenced services.

License
-------

[](#license)

MIT

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity65

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~364 days

Total

3

Last Release

2982d ago

Major Versions

v0.0.1 → v1.0.02016-03-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/2dd2fd22b17ab8ee5da28e496df93327d1920b75bbccb98d76bc4e933f5f5815?d=identicon)[ojezu](/maintainers/ojezu)

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ojezu-add-call-to-remote-service-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/ojezu-add-call-to-remote-service-bundle/health.svg)](https://phpackages.com/packages/ojezu-add-call-to-remote-service-bundle)
```

###  Alternatives

[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[pentiminax/ux-datatables

DataTables.net integration for Symfony

605.6k](/packages/pentiminax-ux-datatables)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[symfony/ux-cropperjs

Cropper.js integration for Symfony

19280.3k3](/packages/symfony-ux-cropperjs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
