factory
factory copied to clipboard
Object factory that is able to resolve dependencies from PSR-11 container
Fix docs
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start)...
```php $factory->create(EngineInterface::class, 146); ``` instead of ```php $factory->create([ 'class' => EngineInterface::class, '__construct()' => [ 'power' => 146, ], ]); ```
For example, `FactoryReference` and `ContainerReference`.
For use in callable definitions: `'my-definition' => static fn(Factory $fn) => $fn->create(...);`
This is necessary for consistenc with `StrictFactory`, where `$definitions` is required parameter and is in the first place.