Registry / utility / yiisoft-injector

yiisoft-injector

JSON →
library1.2.1phppackagistunverified

PSR-11 compatible injector. Executes a callable and makes instances by injecting dependencies from a given DI container.

composer require yiisoft/injector
INSTALL
IMPORT
SIG · YIISOFT-INJECTOR
Y
yiisoft-injector
utilityphpv1.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Injector
use Yiisoft\Injector\Injector;

Create an injector and invoke a callable with dependency injection.

use Yiisoft\Injector\Injector; use Psr\Container\ContainerInterface; $injector = new Injector($container); $result = $injector->invoke(function (SomeService $service) { return $service->doSomething(); });
Debug
Known issues
breakingRequires PHP 7.4+.
fix
Upgrade PHP to 7.4 or higher.
affects: <1.0.0
Upgrade
Version history
1.2.1latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
yiisoft-injector — pip install yiisoft-injector · libregistry