ServiceContainer: Chained loaders and generic return types
Published on by Greg Bowler
It’s now possible to chain the loader functions in ServiceContainer classes. This means that the loader functions can in turn have their own typed parameters automatically injected, just like the go functions in webengine.
An improvement has been made the the use of docblocks - now your IDE will understand that the returned type from Container::get is the type that is requested in the parameter. One day PHP will support generics and we’ll not need to depend on doc blocks.
What’s Changed
- build(deps-dev): bump phpstan/phpstan from 1.8.0 to 1.8.1 by @dependabot in https://github.com/PhpGt/ServiceContainer/pull/90
- feature: chained loaders by @g105b in https://github.com/PhpGt/ServiceContainer/pull/94
- feature: implement generic return type by @g105b in https://github.com/PhpGt/ServiceContainer/pull/93
- build(deps-dev): bump phpstan/phpstan from 1.8.1 to 1.8.2 by @dependabot in https://github.com/PhpGt/ServiceContainer/pull/91
Full Changelog: https://github.com/PhpGt/ServiceContainer/compare/v1.1.3...v1.2.0