firehed/container
Dependency inversion container with advanced autowiring and compilation support. PSR-11 compliant.
1.1.0
570K downloads/mo
#2311 most downloaded on Packagist
Firehed/container
What this package is like to depend on
Last release 2 months ago
10 Jun 2026
Release timing varies
gaps range from 2 weeks to 2.2 years
Some releases are documented
notes for 10 of 17 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
17 releases · first in 2019
3 releases in the last 12 months
see the full history below
Release timeline
17 releases · Mar 2019 to Jun 2026Releases
latest 17-
1.1.010 Jun 2026Release notes
Open source →Summary
- Resolved an issue where autowired classes with optional constructor parameters (
__construct(?Foo $foo = null)) would never have the optional parameters resolved, even if available in the container - Major groundwork for external extensibility with
DefinitionInterface. This is still considered internal for now, but the goal is to enable use-cases like fetching secrets from vaults, etc. - Bumped numerous internal tools and updated to requiring a currently-supported PHP version (8.2+)
What's Changed
- Add DefinitionInterface for extensible container definitions by @Firehed in #75
- Extract Autowire utility for shared eligibility checks by @Firehed in #79
- Check container for optional params before using default by @Firehed in #82
- Update to PHPUnit 11-13, require PHP 8.2+ by @Firehed in #83
- Add Dependabot configuration by @Firehed in #84
- Bump actions/checkout from 4 to 6 by @dependabot[bot] in #87
- Bump actions/cache from 4 to 5 by @dependabot[bot] in #88
- Bump codecov/codecov-action from 4 to 6 by @dependabot[bot] in #85
- Update phpcs to ^4.0 by @Firehed in #90
- Update PHPUnit config and make it stricter by @Firehed in #91
- Update envvar reader to leverage new DefinitionInterface by @Firehed in #76
- Extract Autowire::instantiate() for reuse by @Firehed in #98
- Convert FactoryInterface to DefinitionInterface by @Firehed in #99
- Convert AutowireInterface to DefinitionInterface by @Firehed in #97
- Unify finalization pattern with ShorthandDefinitionInterface by @Firehed in #101
- Convert Closure handling to DefinitionInterface by @Firehed in #102
- Convert scalar definitions to DefinitionInterface wrappers by @Firehed in #103
- Unify config file parsing by @Firehed in #104
New Contributors
- @dependabot[bot] made their first contribution in #87
Full Changelog: 1.0.0...1.1.0
- Resolved an issue where autowired classes with optional constructor parameters (
-
1.0.007 Mar 2026Release notes
Open source →This is the 1.0.0 release of the container library!
There are three behavioral changes that could be possible BC breaks from the 0.x line:
env()now sources from$_ENVbeforegetenv(). Previously only getenv() was checked.- envvars are now read once when the container is initialized, where previously they were read on the fly. In the unlikely event you modify envvars after the container is initialized throughout the application lifecycle (this is a very bad idea), those updates will no longer be reflected in the container
ValueRetreivalExceptionis now correctly spelledValueRetrievalException(you should still only catch the PSR-11ContainerExceptionInterface, though). If you were catching it anyway, you should a) just catch the PSR interface or b) update to the new name if you really have a good reason.
The first change is to increase compatibility with the default/recommended behavior of
vlucas/dotenv, which will write into$_ENVbut not callputenv(). Basically, there's no need to useunsafemode to support this library (though you still can). Under the majority of deployments, this will be fully compatible. If you havevariables_orderset to a value that excludesEandS(this is rare) inphp.ini, you may encounter unexpected behavior. See README for details.If any code writes non-
stringvalues into$_ENV, reading it will cause an error. This is consistent with the previousgetenv-backed environment reads, which could only be a string.What's Changed
- Overhaul README by @Firehed in #59
- Remove now-redundant assertion by @Firehed in #66
- Allow customization of autodetected environment names by @Firehed in #65
- Bump CI versions by @Firehed in #67
- Explicitly test behavior of 'set but empty' by @Firehed in #68
- Read from $_ENV over getenv() by @Firehed in #69
- Set up
__debugInfo()method by @Firehed in #70 - Set up spellcheck linter by @Firehed in #72
- Fix README inconsistencies by @Firehed in #71
- Handle and test dotenv interoperability by @Firehed in #74
Full Changelog: 0.10.0...1.0.0
-
0.10.019 Sep 2025Release notes
Open source →This improves functionality of the
TypedContainerInterfacewhen interacting with scalar valuesWhat's Changed
- Update build matrix for latest PHP; PHPStan; fix some new warnings by @Firehed in #55
- Add a bunch of covers annotations by @Firehed in #57
- Drop unused parameter in compiler's ProxyValue by @Firehed in #56
- More typed value access tooling by @Firehed in #58
Full Changelog: 0.9.1...0.10.0
-
0.9.122 Aug 2024 -
0.9.022 Aug 2024Release notes
Open source →This release adds support for streamlined reading of environment vars into backed enums. This streamlines common pain points such as environment-specific "drivers" in a more modern PHP deployment.
What's Changed
- Minor updates for newer dependencies by @Firehed in #48
- Update CI tools+deps by @Firehed in #49
- Remove polyfills redundant with PHP 8.1 by @Firehed in #50
- Update internals to native types and constructor promotion by @Firehed in #51
- Support casting env to enum by @Firehed in #43
- Add more detailed explainer in enum section by @Firehed in #52
Full Changelog: 0.8.0...0.9.0
-
0.8.017 Jul 2024Release notes
Open source →What's Changed
- Drop support for legacy versions of PHP by @Firehed in #47
- Support nikic/php-parser v5 by @Firehed in #45
Full Changelog: 0.7.0...0.8.0
-
0.7.011 Feb 2024Release notes
Open source →Adds a new
AutoDetectclass which can greatly simplify setup when following the documented conventions.What's Changed
- Support newer PHPUnit versions by @Firehed in #44
- Add an autodetect tool for the common case by @Firehed in #40
Full Changelog: 0.6.0...0.7.0
-
0.6.029 Jan 2024Release notes
Open source →This releases a bunch of built-up changes for newer versions of PHP and support for improved type-safety when following recommended conventions.
What's Changed
- Test on 8.1 and 8.2 by @Firehed in #33
- Support PHP 8.1 & Enums by @Firehed in #22
- Improve type safety of containers w/ tools by @Firehed in #34
- Improve messaging on various errors by @Firehed in #37
- Adopt some readme formatting enhancements and add a couple clarifications by @Firehed in #41
- Test on 8.3 and 8.4-dev by @Firehed in #42
Full Changelog: 0.5.2...0.6.0
-
0.5.216 Nov 2021Release notes
Open source →This release contains no user-facing runtime changes. It adds some metadata to
composer.jsonto make the package more discoverable.Full Changelog: 0.5.1...0.5.2
-
0.5.105 Nov 2021 -
0.5.004 Nov 2021Nothing published for this version
-
0.4.109 Sep 2021Nothing published for this version
-
0.4.010 Jun 2021Nothing published for this version
-
0.3.029 Sep 2020Nothing published for this version
-
0.2.001 Sep 2020Nothing published for this version
-
0.1.119 Mar 2019Nothing published for this version
-
0.114 Mar 2019Nothing published for this version