Releases: phpgt/ServiceContainer
GT transition
This minor patch release introduces an automatic class alias check for classes within the Gt* namespace prefix, automatically fixing the case to GT*, in preparation of the transition to all repos having the GT namespace prefix.
- Create SECURITY.md by @g105b in #144
- Add JetBrains sponsorship to README with H1 heading by @g105b in #146
- 147-gt-transition by @g105b in #148
Full Changelog: v1.3.2...v1.3.4
January 2024 release
What's Changed
Full Changelog: v1.3.1...v1.3.3
Supply extra arguments to individual invocations
What's Changed
Full Changelog: v1.3.1...v1.3.2
Functions without a type are ignored
In this minor patch release, we skip any functions on the ServiceContainer that do not have a return type noted. This is so, when extending your own ServiceContainer, you will be allowed to put logic in the constructor (constructors are not allowed to have a return type).
What's Changed
Full Changelog: v1.3.0...v1.3.1
LazyLoad is no longer required
The main feature to this minor release is to drop the requirement of the #[LazyLoad] attribute. This attribute's usage has been removed, due to the simplification of the library to utilise any public method on the service container class.
What's Changed
- Public methods are used instead of LazyLoad by @g105b in #135
- CI and matrix builds by @g105b in #134
- docs: update docs to point to new ci tools by @g105b in #136
Full Changelog: v1.2.1...v1.2.2
Minor tweaks and improvements
What's Changed
Full Changelog: v1.2.0...v1.2.1
Chained loaders and generic return types
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 #90
- feature: chained loaders by @g105b in #94
- feature: implement generic return type by @g105b in #93
- build(deps-dev): bump phpstan/phpstan from 1.8.1 to 1.8.2 by @dependabot in #91
Full Changelog: v1.1.3...v1.2.0
Lazier LazyLoad
The new feature in this release is the "lazier" LazyLoad attribute. Before, the LazyLoad attribute was required to state the type of object it loaded, but now if there's a return type on the class itself, the type annotation in the attribute is not mandatory.
Along with this feature, the development dependencies have been set to a hard version constraint to help with predictable builds.
Nullable injections
This minor patch release allows nullable types to be requested by the Injector class. This means that if your function parameter has a type such as ?App\User, it will still try to inject the App\User class. This is super useful for WebEngine applications, allowing go functions to simply have a nullable User parameter to indicate whether on not the user is authenticated.
Lazy loading from class
This patch release allows the lazy loading feature from the previous release to be added to any class, by adding the #[LazyLoad(ClassName)] tag to any class.