PackageTrack
Sign in Get early access

lucatume/di52

A PHP 5.6 compatible dependency injection container.

4.1.0 1.7M downloads/mo #3285 most downloaded on Packagist lucatume/di52

What this package is like to depend on

Last release 2 months ago

24 Jun 2026

Release timing varies

gaps range from 2 weeks to 1.2 years

Nearly every release is documented

notes for 58 of 62 stable releases

Nothing withdrawn

no release was ever pulled

11 years old

63 releases · first in 2015

1 release in the last 12 months

see the full history below

Release timeline

63 releases · Nov 2015 to Jun 2026
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 60 of 63
  1. 4.1.0 24 Jun 2026
    Release notes

    4.1.0

    Added

    • The Container::mergeArrayVar method to the Container, enabling developers to add a list of implementations to a binding (thanks @dpanta94).
    Open source →
    Release notes

    Added

    • The Container::mergeArrayVar method to the Container, enabling developers to add a list of implementations to a binding (thanks @dpanta94).
    Open source →
  2. 4.0.1 01 Apr 2025
    Release notes

    4.0.1

    Fixed

    • Fixed Container::unsetOffset method behavior to ensure singletons and when-needs-gives bindings are correctly removed.
    Open source →
    Release notes

    Fixed

    • Fixed Container::unsetOffset method behavior to ensure singletons and when-needs-gives bindings are correctly removed.
    Open source →
  3. 4.0.0 14 Dec 2024
    Release notes

    4.0.0

    Changed

    • Bumped minimum supported version to PHP 7.1.
    • Fixed PHP 8.4 deprecation warnings.
    Open source →
    Release notes

    Changed

    • Bumped minimum supported version to PHP 7.1.
    • Fixed PHP 8.4 deprecation warnings.
    Open source →
  4. 3.3.7 26 Apr 2024
    Release notes

    3.3.7

    Fixed

    • Correctly bind the container to the builders and resolvers when cloning the container.
    Open source →
    Release notes

    Fixed

    • Correctly bind the container to the builders and resolvers when cloning the container.
    Open source →
  5. 3.3.6 02 Apr 2024
    Release notes

    3.3.6

    Added

    • The afterBuildAll parameter to the bindDecorators and singletonDecorators method, fixes #61.
    Open source →
    Release notes

    Added

    • The afterBuildAll parameter to the bindDecorators and singletonDecorators method, fixes #61.
    Open source →
  6. 3.3.5 01 Sep 2023
    Release notes

    3.3.5

    Changed

    • Added PHPStan generics to multiple classes. IDEs that support them will get autocompletion (.phpstorm.meta.php not required) if a fully-qualified class name is used, e.g. $instance = $container->get( Test::class ); (thanks @defunctl).
    Open source →
    Release notes

    Changed

    • Added PHPStan generics to multiple classes. IDEs that support them will get autocompletion (.phpstorm.meta.php not required) if a fully-qualified class name is used, e.g. $instance = $container->get( Test::class );.
    Open source →
  7. 3.3.4 20 Jun 2023
    Release notes

    3.3.4

    Added

    • Implement the Container::__clone method to clone the container accessory classes correctly upon cloning.

    Changed

    • The Container::__construct method will bind itself to the Psr\Container\ContainerInterface interface as a singleton.
    • If the Container class is extended, it will bind itself to the extended class in the __construct and __clone methods.
    Open source →
    Release notes

    Added

    • Implement the Container::__clone method to clone the container accessory classes correctly upon cloning.

    Changed

    • The Container::__construct method will bind itself to the Psr\Container\ContainerInterface interface as a singleton.
    • If the Container class is extended, it will bind itself to the extended class in the __construct and __clone methods.
    Open source →
  8. 3.3.3 28 Apr 2023
    Release notes

    3.3.3

    Fixed

    • Return value of the App::callback method to be callable (thanks @estevao90).
    Open source →
    Release notes

    Fixed

    • Return value of the App::callback method to be callable (thanks @estevao90).
    Open source →
  9. 3.3.2 07 Apr 2023
    Release notes

    3.3.2

    Fixed

    • Set the correct return type for the Container::callback function (thanks @estevao90).
    Open source →
    Release notes

    Fixed

    • Set the correct return type for the Container::callback function (thanks @estevao90).
    Open source →
  10. 3.3.1 17 Mar 2023
    Release notes

    3.3.1

    Fixed

    • Allow bound interfaces to properly resolve their concrete class when the concrete class has contextual bindings (thanks @defunctl). e.g. the following will now work properly:
    $container = new \lucatume\DI52\Container();
    $container->bind(SomeInterface::class, SomeClass::class);
    $container->when(Someclass:class)
        ->needs('$num')
        ->give(20);
    
    // This now works, properly resolving SomeClass::class.
    $instance = $container->get(SomeInterface::class);
    Open source →
    Release notes

    Fixed

    • Allow bound interfaces to properly resolve their concrete class when the concrete class has contextual bindings (thanks @defunctl). e.g. the following will now work properly:
    $container = new \lucatume\DI52\Container();
    $container->bind(SomeInterface::class, SomeClass::class);
    $container->when(Someclass:class)
        ->needs('$num')
        ->give(20);
    
    // This now works, properly resolving SomeClass::class.
    $instance = $container->get(SomeInterface::class);
    
    Open source →
  11. 3.3.0 28 Feb 2023
    Release notes

    Breaking change

    • Removed the aliases.php file from the package autoloading. Take a look at the README.md file to see how to gracefully upgrade to version 3.3
    Open source →
  12. 3.2.1 28 Feb 2023
    Release notes

    Fixed

    • Correctly resolve unbound parameters to default value when available.
    Open source →
  13. 3.2.0 27 Feb 2023
    Release notes

    Changed

    • Allow customization of rethrown exceptions catpured during container resolution; alter message, file and line by default.

    Fixed

    • Some App generated methods signatures.
    Open source →
  14. 3.1.1 16 Feb 2023
    Release notes

    Changed

    • Removed leftover @since TBD comments.
    Open source →
  15. 3.1.0 28 Jan 2023
    Release notes

    Added

    • PHP8.2 support.
    • Parameter detection support for PHP Union Types.
    • Parameter Enum detection/Enum container resolving.
    • thanks @defunctl.

    Changed

    • Add PHP8.2 to GitHub workflow matrix.
    • Separated tests into a unit suite and a php81 suite to avoid fatal parse errors when asserting enums.
    • Updated GitHub workflows to remove deprecated functionality and run composer install via https://github.com/ramsey/composer-install.
    • Updated GitHub workflows to attempt to automatically migrate the phpunit configuration file based on the current version being run.
    • Updated deprecated "actions/checkout" GitHub action from v2 to v3.
    • thanks @defunctl.

    Fixed

    • Use the correct PHP version ID to ensure PHP81ContextualBindingContainerTest runs under PHP8.1.
    • Fixed the phpunit.xml schema to validate against phpunit 5.7.
    • Fatal Error Handling snapshots.
    • thanks @defunctl.
    Open source →
  16. 3.0.3 24 Jan 2023
    Release notes

    Added

    • The container now registers Service Providers using its own Container::get() method, instead of the new keyword. This allows Service Providers to utilize dependency injection. (thanks @defunctl).
    • Additional contextual binding examples for primitives + service provider documentation in the README.
    Open source →
  17. 3.0.2 20 Jan 2023
    Release notes

    Added

    • Add support for resolving primitive values (e.g. int, string, bool etc...) using Container::when(), Container::needs() and Container::give() (thanks @defunctl).
    Open source →
  18. 3.0.1 16 Nov 2022
    Release notes

    Changed

    • Add .gitattributes file to exclude development artifacts. (thanks @Luc45)
    Open source →
  19. 3.0.0 09 Feb 2022
    Release notes

    Changed

    • Add support for a default value in the lucatume\DI52\Container::getVar(string $key, mixed $default = null) :mixed method.
    • The lucatume\DI52\Container::setVar(string $key, mixed $value) :void will not try to run callables when storing variables on the container using the method. As such, the need to protect the variables when using the setVar() method is no more required.
    • The lucatume\DI52\Container::tagged(string $tag) :array method will now return an empty array if nothing was tagged with the tag; it would throw an error in previous versions.
    • Rewritten the code to fully leverage Closure support.
    • Move build tools to Docker.
    • Make the container implementation compatible with [PSR-11 Container specification](https://www.php-fig. org/psr/psr-11/)
    • Fix #26 to handle and format files syntax errors while trying to autoload.
    • Fix #13 and allow explicit definition of default binding method.
    • Allow getting the registered provider instances using getProvider and get, make or the ArrayAccess API.
    • Allow getting callbacks for static and instance methods consistently to unhook.
    • Add phstan, phan and phpcs checks.
    • Move benchmarks to Docker, automate them.
    • Update documentation and examples.

    Removed

    • Removed the tad_DI52_ServiceProviderInterface and tad_DI52_ContainerInterface interfaces.
    Open source →
  20. 2.1.5 20 Dec 2021
    Release notes

    Fixed

    • PHP 8.1 compatibility issues (thanks @bordoni)
    Open source →
  21. 2.1.4 01 Jan 2021
    Release notes

    Fixed

    • PHP 8 compatibility issues (thanks @bordoni)
    Open source →
  22. 2.1.3 02 Nov 2020
    Release notes

    Fixed

    • Error messages and format in the context of nested make resolution (thanks @Luc45)
    Open source →
  23. 2.1.2 27 Oct 2020
    Release notes

    Fixed

    • PHP 5.3 and 7.4 incompatibility issues

    Changed

    • moved the builds to GitHub Actions
    Open source →
  24. 2.1.1 23 Oct 2020
    Release notes

    Added

    • new build tools to the repository

    Changed

    • refactor Container::callback code to re-use callbacks when available (thanks @sc0ttkclark)

    Fixed

    • fix an issue where the Closure produced by the callback method would build the object for static method calls
    Open source →
  25. 2.1.0 14 Jul 2020
    Release notes

    Added

    • support for one parameter singletong binding of concrete, instantiatable, classes, thanks @Luc45
    Open source →
  26. 2.0.12 14 Oct 2019
    Release notes

    Added

    • add PHPStorm make method auto-completion (thanks @Luc45)
    Open source →
  27. 2.0.11 26 Sep 2019
    Release notes

    Changed

    • improve exception throwing to show original exceptions when the building of a bound class, interface or slug fails
    Open source →
  28. 2.0.10 29 Oct 2018
    Release notes

    Fixed

    • an issue with array variable handling
    • made error message more clear for non-string offsets
    Open source →
  29. 2.0.9 26 Sep 2017
    Release notes

    Fixed

    • issue with setVar method where, in some instances, variable values could not be overridden
    Open source →
  30. 2.0.8 18 Jul 2017
    Release notes

    Fixed

    • check for file existence in autoload script (thanks @truongwp)
    Open source →
  31. 2.0.7 15 Jun 2017
    Release notes

    Fixed

    • issue where non registered classes object dependencies would be built just the first time (issue #2)
    Open source →
  32. 2.0.6 09 May 2017
    Release notes

    Fixed

    • fix handling of unbound interface arguments
    Open source →
  33. 2.0.5 21 Apr 2017
    Release notes

    Changed

    • change internal method visibility to improve compatibility with monkey patching libraries
    Open source →
  34. 2.0.4 22 Feb 2017
    Release notes

    Fixed

    • allow unbound classes with __construct method requirements to be used in instance callbacks
    Open source →
  35. 2.0.3 07 Feb 2017
    Release notes

    Fixed

    • support for use of callback to feed instance and viceversa
    Open source →
  36. 2.0.2 02 Feb 2017
    Release notes

    Fixed

    • support for built objects in instance and callback methods
    Open source →
  37. 2.0.1 23 Jan 2017
    Release notes

    Fixed

    • an issue where re-binding implementations could lead to built objects still using previous bindings

    Changed

    • removed some dead code left over from previous iterations
    Open source →
  38. 2.0.0 21 Jan 2017
    Release notes

    Added

    • instance and callback methods

    Changed

    • refactored the code completely
    • the README file to update it to the new code

    Removed

    • support for array based construction instructions (see instance methods)
    Open source →
  39. 1.4.5 19 Jan 2017
    Release notes

    Fixed

    • an issue where singleton resolution would result in circular reference on some Windows versions (thanks @bordoni)
    Open source →
  40. 1.4.4 09 Jan 2017
    Release notes

    Added

    • support for binding replacement
    Open source →
  41. 1.4.3 18 Oct 2016
    Release notes

    Changed

    • snake_case method names are now set to camelCase

    Fixed

    • an inheritance issue on PHP 5.2
    • non PHP 5.2 compatible tests

    Added

    • Travis CI support and build
    Open source →
  42. 1.4.2 14 Oct 2016
    Release notes

    Fixed

    • nested dependency resolution issue with interfaces and default values
    Open source →
  43. 1.4.1 14 Oct 2016
    Release notes

    Fixed

    • updated tad_di512_Container bind and singleton methods signatures
    Open source →
  44. 1.4.0 14 Oct 2016
    Release notes

    Added

    • more informative exception message when trying to resolve unbound slug or non existing class
    • support for after build methods

    Fixed

    • another nested dependency resolving issue
    Open source →
  45. 1.3.2 28 Jul 2016
    Release notes

    Fixed

    • nested dependency resolving issue
    Open source →
  46. 1.3.1 18 Apr 2016
    Release notes

    Added

    • more informative exception message when default primitive value is missing
    Open source →
  47. 1.3.0 18 Apr 2016
    Release notes

    Added

    • support for the custom bindings
    • support for same class singleton binding

    Changed

    • performance optimization
    Open source →
  48. 1.2.6 11 Apr 2016
    Release notes

    Changed

    Open source →
  49. 1.2.6-alpha 07 Apr 2016 pre-release

    Nothing published for this version

  50. 1.2.5 06 Apr 2016
    Release notes

    Added

    • support for decorator pattern in PHP 5.2 compatible syntax
    • code highlighting for code examples in doc (thanks @omarreiss)
    Open source →
  51. 1.2.4 05 Apr 2016
    Release notes

    Added

    • tests for uncovered code
    Open source →
  52. 1.2.3 05 Apr 2016
    Release notes

    Fixed

    • singleton resolution for same implementations
    Open source →
  53. 1.2.2 13 Feb 2016
    Release notes
    • doc updates
    Open source →
  54. 1.2.1 23 Jan 2016
    Release notes

    Added

    • hasTag($tag) method to the container
    • isBound($classOrInterface) method to the container
    • support for deferred service providers
    Open source →
  55. 1.2.0 22 Jan 2016
    Release notes

    Added

    Open source →
  56. 1.1.2 19 Jan 2016
    Release notes

    Fixed

    • resolution for objects in arrays
    Open source →
  57. 1.1.1 19 Jan 2016
    Release notes

    Added

    • support for the %varName% variable notation.
    Open source →
  58. 1.1.0 18 Jan 2016
    Release notes

    Added

    • array resolution support for the Array Access API.
    • the changelog.
    Open source →
  59. 1.0.3 29 Nov 2015

    Nothing published for this version

  60. 1.0.2 25 Nov 2015

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive