Skip to content

Releases: phpgt/ServiceContainer

GT transition

28 Oct 10:36
60e01f6

Choose a tag to compare

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.

Full Changelog: v1.3.2...v1.3.4

January 2024 release

12 Jan 16:12
733778c

Choose a tag to compare

What's Changed

  • feature: check extra args before container by @g105b in #141

Full Changelog: v1.3.1...v1.3.3

Supply extra arguments to individual invocations

10 Nov 11:58
733778c

Choose a tag to compare

What's Changed

  • feature: check extra args before container by @g105b in #141

Full Changelog: v1.3.1...v1.3.2

Functions without a type are ignored

04 Jul 11:36
c64d1bd

Choose a tag to compare

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

  • tweak: skip methods without a return type by @g105b in #139

Full Changelog: v1.3.0...v1.3.1

LazyLoad is no longer required

29 Jun 11:41
9b9e65e

Choose a tag to compare

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

26 Sep 17:51
653f928

Choose a tag to compare

What's Changed

  • maintenance: dependabot by @g105b in #102
  • feature: set multiple services at once by @g105b in #104

Full Changelog: v1.2.0...v1.2.1

Chained loaders and generic return types

24 Jul 22:35
bdfd2f2

Choose a tag to compare

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

06 Jul 14:16
8628f96

Choose a tag to compare

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

09 Nov 11:43
8d0faf7

Choose a tag to compare

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

02 Oct 09:18
10b237f

Choose a tag to compare

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.