NewYour coding agent can read the release notes before it upgrades.Set up the MCP server β
Packagist
Packagist, #934 most downloaded on Packagist
π Nette DI: a dependency injection container with autowiring, configured in NEON and compiled into readable PHP code. Factories and accessors are generated from an interface alone.
Latest stable
v3.2.8
Last release 27 days ago
26 Oct 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
73 releases Β· first in 2014
Drag across the ruler to compare, or tap a release to open it.
Support for nette/neon 4.0 : configuration files are read the same way as with 3.x, which keeps working
#[SensitiveParameter] now hides arrays and other non-scalar arguments too, so database credentials passed as an array no longer show up in Tracy's source snippetsNette\DI\Definitions\Definition now lives at Nette\DI\Definition; the old name keeps working as an aliasget*() or create*() method of the interface, and every method with a non-nullable return type must have its reference. A typo in a key now fails compilation with a message naming the reference or method, where it used to compile and throw MissingServiceException only on the first call. Fix the key, or make the method's return type nullable if the service is truly optional. Interfaces with a generic get($name) are exempt.__, which is reserved for encoding dots in the names of generated methods.getPDO() finds the reference pdo (and still pDO), the same for getURL(), getDB() and the likeContainer::createInstance() and callMethod() pass the actual value to a scalar parameter marked #[SensitiveParameter]getServiceDescriptors() reports a service named PDO under its real name instead of pDOYour coding agent can read these notes before it upgrades. Set up the MCP server β
The container stops being a black box. This release adds a first-class introspection API, a PSR-11 bridge, and β finally β containers that actually re
The container stops being a black box. This release adds a first-class introspection API, a PSR-11 bridge, and β finally β containers that actually reload themselves in long-running processes instead of silently serving a stale build forever. A handful of quiet misconfigurations were also promoted to loud errors.
ContainerLoader now gives every build a fresh class name (Container_<key>_<hash>) and, on every load(), checks the compiled file's content rather than merely whether it has just been regenerated, so a rebuild done by another process over the same cache (a web request while your worker runs) is picked up as well. A process simply gets a new container instance whenever its configuration changed, with no restart. Without auto-rebuild nothing changes: production still compiles once and never looks back.Container::getServiceDescriptors() β a read-only snapshot of every registered service (name, type, autowiring, tags, aliases, and the instance if it exists), in definition order, without instantiating anything. Tools that until now read the container's private properties through Closure::bind() and scanned createService* methods by reflection can drop the tricks; the Tracy panel already has.Nette\Bridges\DIPsr\PsrContainer β wrap your container and hand it to any library that speaks PSR-11. get() resolves both service names and autowired types, with ambiguity reported rather than guessed.setup, so @self and self-typed arguments work there like anywhere else.addService() refuses a name already taken by a factory, matching the existing behavior for instances. The counterpart: removeService() now removes factories too, so a name freed by removeService() is genuinely free.A maintenance release laser-focused on type safety. Static analysis is now mandatory in CI, the codebase ships richer native and PHPDoc types, and the
A maintenance release laser-focused on type safety. Static analysis is now mandatory in CI, the codebase ships richer native and PHPDoc types, and the Tracy DI panel got a cleaner Latte rewrite. No behavioral changes β just a sturdier foundation for everything built on top.
Compiler, ContainerLoader, ServiceDefinition and friendsn:attributes for noticeably cleaner Latte syntax@param, @return and class descriptions across Compiler, Container, ContainerBuilder, Resolver, Helpers, definitions and extensions, giving IDEs and static analyzers far more to work withoptimized global function calls
implemented support for lazy services in PHP 8.4
fixed ReflectionParameter::getDefaultValue() error #315
ReflectionParameter::getDefaultValue() error #315Revert "LocatorDefinition: deprecated support for create($name) method (BC break)"
filterArguments() (BC break)Container::getServiceType() ignores dynamically added services (BC break)Container::getByType() fixed cooperation with dynamic factory #314normalizeEntity() fails due to service replacementPhpGenerator: DTO and DateTime are not suspicious objects #306 #308
%parameters% is deprecated (BC break)
changes
create($name) method (BC break)ParametersExtension: exports both statements and dynamic parameters, preloads only the latter
Resolver::autowireArgument() fixed handling of new-initializer with typehint #302NeonAdapter::removeUnderscoreVisitor() checks if key doesn't existParametersExtension, Container: redesigned way of exporting dynamic parameters via getParameter() #291
getParameter() #291Helpers::expand() allow concatenation of Statements #288<Type> syntax for autowiring a collection of services (#293)@self to setup immediatelyResolver: tolerates nullable types when resolving
ContainerPanel: removed padding & word-break for dumps, class name moved to the top and removed from the header
Resolver::autowireArguments() fixed support for variadicsContainer::getByType() compatibility with PHPStan (#285)Container: added typehint object
Adapter::dump() interface methoddeprecated options 'parameters', 'dynamic', 'class' (instead of 'type') in configuration
Changes:
Deprecations:
@return are deprecatedResolver: added support for named variadics #289
initialize()ContainerPanel: removed padding & word-break for dumps
Resolver::autowireArguments() fixed support for variadicsv3.0 maintenance has been ended, please update to v 3.1
revert "used generics (#261)" [Closes #274]
ExtensionsExtension: removed final #280
private constants are PascalCase
Resolver::resolveEntityType() ignores return types 'object' & 'mixed' #274
Resolver::resolveEntityType() ignores return types 'object' & 'mixed' #274Resolver::autowireArgument() uses named arguments to skip optional parameters in PHP 8Resolver::autowireArguments() improved support for variadicsautowireArguments()setCreator() & getCreator(), aliases for setFactory() & getFactory()The _ are removed using Neon visitor #264 (requires neon/neon 3.3)
Resolver::autowireArguments() throws an exception when combining a named and positional parameter" #265added _ as alias for ... in config
$params in definitionResolver::autowireArguments() throws an exception when combining a named and positional parameterFactoryDefinition::resolveType() checks for type compatibilityResolver::completeException() truncates but does not remove the class nameHelper::ensureClassType()Reflection::getReturnTypes() etcadded support for enums in config file
Resolver: handles nullable or default union|types
Compiler: triggers schema warnings
Resolver::completeException() appends entity to exception message when type is not known
completeException() appends entity to exception message when type is not knownFor the details you can have a look at the diff.
added new internal functions bool(), int(), float(), string()
bool(), int(), float(), string()Helpers::escape()For the details you can have a look at the diff.
Resolver: fixed self-dependency #240
findByType()getByName() as alias for getService()For the details you can have a look at the diff.
CompilerExtension: added $initialization as replacement for modifying initialize() method
initialize() methodFor the details you can have a look at the diff.
InjectExtension: accepts native type
autowireArguments() fixed counting optional argsautowireArguments() refactoring, added autowireArgument(), Resolver|Container replaced with callbackFor the details you can have a look at the diff.
Revert "Container: deprecated support for dynamically added services (BC break)" #203
create() (#200)For the details you can have a look at the diff.
removed deprecated support for inheritance 'child < parent' (BC break)
tags and parametersNothing published for this version
Helpers::expand() fixed expansion of dynamic parameters
expand() fixed expansion of dynamic parametersFor the details you can have a look at the diff.
compatibility with nette/php-generator 3.x #182
loadDefinitions() sorts definitions only if neededvalidateConfig() prints 'section βΊ value' instead of section.value in exception messageFor the details you can have a look at the diff.
ContainerBuilder::resolveImplement supports polymorphism
expand() supports %dynamic.item% for dynamic parametersFor the details you can have a look at the diff.
ContainerBuilder::completeStatement() improved error message
completeStatement() improved error messageautowireArguments() improved error messageFor the details you can have a look at the diff.
ContainerPanel: compatibility with Tracy 2.5
For the details you can have a look at the diff.
DecoratorExtension: do not decorate accessors by inner type (possible BC break)
For the details you can have a look at the diff.
added ServiceBuilder::setType() & getType() as a future replacements for setClass() and getClass()
setType() & getType() as a future replacements for setClass() and getClass()For the details you can have a look at the diff.
coding style: fixes, lowercase true/false/null
class_alias() #156For the details you can have a look at the diff.
Compiler::loadDefinitions: allow to get to existing service by class #145
getByType() added argument $throwisExpired() can alter $phpFiles modification times #144getReturnType() ignores 'object' and 'mixed'create_function() replaced with eval()For the details you can have a look at the diff.
Compiler::addExtension() allows empty name
addExtension() allows empty nameeach() replaced with current() and next()For the details you can have a look at the diff.
PhpGenerator: generates native return type hints
getDefinitionByType() method added #130 (#137)literal() can have argumentsgetParameterDefaultValue() to prevent Fatal Error when invalid constant is usedFor the details you can have a look at the diff.
ContainerBuilder: support for nullable types in generated factories #132
process() is public #134For the details you can have a look at the diff.
InjectExtension: fixed injecting of services which cannot be autowired via @inject #127
completeStatement() uses autowiring only when class is knownFor the details you can have a look at the diff.
Helpers::autowireArguments() can handle PHP 7.1 nullable types
autowireArguments() can handle PHP 7.1 nullable typesgetReturnType() can handle PHP 7.1 nullable typesgetParameterType() can handle PHP 7.1 nullable types (#126)getParameterType() supports type 'self'getInjectMethods() correct order of methods in traitsgetParameterType() in PHP < 7 #124For the details you can have a look at the diff.
PhpReflection::parseAnnotation() regexp fix
parseAnnotation() regexp fixFor the details you can have a look at the diff.
ContainerBuilder: improved exception messages
realpath() to be compatible with FileMock #120implode() #119For the details you can have a look at the diff.
Statement::setEntity() is deprecated
$prop = value and '$prop[]' = value@extension syntax for referencing services from a same extension (#85)deprecated, changed:
parseServices() and parseService() renamed to loadDefinition() and loadDefinitions() (#112)setImplementType() and getImplementType() renamed to setImplementMode() & getImplementMode()load() swapped arguments (BC break)setClassName() & getClassName() moved to Compiler (BC break)setEntity() is deprecatedFor the details you can have a look at the diff.
compatibility with nette/php-generator v2.6 #150
create_function() replaced with eval()mkdir() race conditioneach() replaced with current() and next()For the details you can have a look at the diff.
ServiceDefinition::setImplementType() and getImplementType() aliased to setImplementMode() & getImplementMode()
setImplementType() and getImplementType() aliased to setImplementMode() & getImplementMode() (#122)For the details you can have a look at the diff.
ContainerLoader::load() allows swapped arguments
load() allows swapped argumentsFor the details you can have a look at the diff.
PhpReflection: fixed expanding to FQCN in bracketed namespace
setClassName()For the details you can have a look at the diff.
PhpReflection::expandClassName() added support for @return $this
expandClassName() added support for @return $thisparseUseStatemenets(): class in use can contain leading \ #97ob_start() is protected against flush when error occursFor the details you can have a look at the diff.
Compiler: calls prepareClassList() after each beforeCompile() #94
prepareClassList() after each beforeCompile() #94For the details you can have a look at the diff.
Container: added getServiceType()
getServiceType()removeAlias() removes aliasescheckCase() checks interfaces tooautowireArguments() better error message for PHP7 and class name case mismatchFor the details you can have a look at the diff.
Compiler, CompilerExtension: shows suggestions for unexpected config items and extensions
For the details you can have a look at the diff.
ContainerBuilder: added support for PHP7 type hints
dump() for data with simple Nette\DI\StatementFor the details you can have a look at the diff.
One column per quarter.