Download the PHP package paysera/lib-dependency-injection without Composer
On this page you can find all versions of the php package paysera/lib-dependency-injection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package lib-dependency-injection
Helper classes for Symfony Dependency Injection component
What is this?
Extra features for easier integration with Symfony Dependency Injection component.
Contains compiler pass for registering tagged services with some another service - no need to write custom class in each and every case.
Installation
Basic functionality
To register tagged services to some other service. Optionally passes attributes of the tag, too.
Using priority
Sometimes we need to call method with tagged services by some pre-defined priority. We could prioritize in the service itself, but this makes code duplicated and also is not as quick as ordering in compile-time – no need to sort anything in the run-time.
Priority should be enabled when registering compiler pass.
It's provided in priority
attribute.
Lower the priority, earlier the call.
If priority is not provided, defaults to 0
.
Resolves to:
Tuning performance
When adding many services by method calls, all of them need to be created when instantiating the collector service. This could get troublesome if number of services is high.
This is why you can configure a few options to use instead of just passing the service:
lazy_service
– pass the service as normally, but mark all services lazy. This makes it faster in production in most cases, but can be quite slow in development, as container must be rebuilt every time you modify any of those services (even the code itself);id
– pass only ID of the service, also make tagged service public. This requires you to injectcontainer
into your collector and get services by ID when needed.
Semantic versioning
This library follows semantic versioning.
See Symfony BC rules for basic information about what can be changed and what not in the API.
Running tests
Contributing
Feel free to create issues and give pull requests.
You can fix any code style issues using this command:
All versions of lib-dependency-injection with dependencies
symfony/dependency-injection Version ^2.3|^3.0|^4.0|^5.0|^6.0
symfony/config Version ^2.3|^3.0|^4.0|^5.0|^6.0