di
di copied to clipboard
PSR-11 compatible DI container and injector
### What steps will reproduce the problem? Run `yiisoft/demo` via RR(`yiisoft/yii-runner-roadrunner`) 1st request is handled properly, after which StateResetter::reset() is invoked in subsequent requests container returns instances with unresolved properties...
1. How many services are requested per route? 2. How many aren't defined in container and automatically resolved? 3. How many sub-dependencies are per service?
Hi. Made some experiments with profiling and container performance tests. Found a couple of places where code can be optimized without breaking backward compatibility. - Removed overhead for search in...
| Q | A | ------------- | --- | Is bugfix? | ✔️ | New feature? | ✔️ | Breaks BC? | ❌ | Fixed issues | Added ability to...
| Q | A | ------------- | --- | Is bugfix? | ❌ | New feature? | ✔️ | Breaks BC? | ❌ | Related issues | https://github.com/yiisoft/di/issues/197, https://github.com/yiisoft/definitions/pull/58
Support lazy services via [ocramius/proxy-manager](https://github.com/Ocramius/ProxyManager) May be useful for [view injections](https://github.com/yiisoft/yii-demo/tree/0ac225bafbf7a2a5bf3919b3fdf0475c94dcee4b/src/ViewInjection) to initialize service only on usage
Added rector/rector to CI and composer.json. Mass creation refers to https://github.com/yiisoft/yii-dev-tool/pull/232
```php public function foo(#[Inject('scalar')] $scalar, #[Tags('messageSource')] $messageSources) { // $scalar is an alternative to $container->get('scalar') // $messageSources is an alternative to $container->get('#messageSource') } ``` Can be also used for class...