Download the PHP package pine3ree/pine3ree-auto-resolving-factory without Composer
On this page you can find all versions of the php package pine3ree/pine3ree-auto-resolving-factory. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pine3ree/pine3ree-auto-resolving-factory
More information about pine3ree/pine3ree-auto-resolving-factory
Files in pine3ree/pine3ree-auto-resolving-factory
Package pine3ree-auto-resolving-factory
Short Description A ioc factory that resolves dependencies using reflection
License BSD-3-Clause
Homepage https://github.com/pine3ree/pine3ree-auto-resolve-factory
Informations about the package pine3ree-auto-resolving-factory
pine3ree auto-resolving factory
This package provides an autowiring reflection-based factory, which operates
using the pine3ree-params-resolver
library
Example:
If the container configuration for the service PostMapper::class
instructs
the container to use the auto-resolving-factory, you can just fetch the service instance
from the container:
The requested service constructor's arguments are resolved in the following way:
-
If the argument is a type-hinted dependency with a fully-qualified-class/interface name the factory tries to load a dependency registered in the container with that class-string as identifier. If no such dependency is found, the factory will try the default provided value, if any, then the
null
value if the argument is nullable, and eventually it will try to instantiate the class directly. An exception is thrown on failure. - If the argument is not type-hinted or is type-hinted with a builtin type the
factory will try to load a service or a parameter value registered in the
container with the parameter name as identifier.
If not found, the factory will try the default provided value, if any, then
the
null
value if the argument is nullable, otherwise an exception is thrown.
All versions of pine3ree-auto-resolving-factory with dependencies
pine3ree/pine3ree-params-resolver Version ^1.0
pine3ree/pine3ree-reflection-helper Version ^1.0
psr/container Version ^1.1.2 || ^2.0