Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Di Laravel Package

nette/di

Nette DI is a fast, configurable dependency injection container for PHP. Compile-time container generation boosts performance, while extensions, autowiring, and service definitions make complex apps easy to wire. Integrates smoothly with the Nette framework or standalone.

View on GitHub
Deep Wiki
Context7
v3.2.6

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.

  • Native types – tightened parameter and return types across Compiler, ContainerLoader, ServiceDefinition and friends
  • ContainerPanel – Tracy panel template rewritten with n:attributes for noticeably cleaner Latte syntax
  • PHPStan-clean codebase – wide-ranging cleanup across DI internals so the whole tree passes strict analysis
  • Richer PHPDoc – improved [@param](https://github.com/param), [@return](https://github.com/return) and class descriptions across Compiler, Container, ContainerBuilder, Resolver, Helpers, definitions and extensions, giving IDEs and static analyzers far more to work with
  • Better generic types – sharpened PHPDoc generics in autowiring, container builder, definitions and resolver
v3.2.5
  • support for PHP 8.5
  • optimized global function calls
  • used generics for Container::createInstance() (#323)
v3.2.4
  • implemented support for lazy services in PHP 8.4
  • Resolver: restrictions for named parameters have been removed
  • Resolver: triggers error when reference is called with arguments
v3.2.3
  • support for PHP 8.4
  • md5 replaced with xxHash
  • fixed ReflectionParameter::getDefaultValue() error #315
v3.2.2
  • Container: refactoring
  • NeonAdapter: resolving of constants and enums moved here from filterArguments() (BC break)
  • Container::getServiceType() ignores dynamically added services (BC break)
  • Container::getByType() fixed cooperation with dynamic factory #314
  • Resolver: better exception when normalizeEntity() fails due to service replacement
  • Revert "LocatorDefinition: deprecated support for create($name) method (BC break)"
v3.2.1
  • PhpGenerator: DTO and DateTime are not suspicious objects #306 #308
  • NeonAdapter: fixed to string conversion #307
  • Compiler::loadDefinitionsFromConfig() expands parameters (after 3399312)
v3.2.0
  • requires PHP 8.1
  • uses PHP 8.1 features
  • Sensitive parameters are put in markers /sensitive{/ and /}/
  • added support for first-class callable syntax in NEON
  • SearchExtension: added 'exclude -> files'
  • ServicesExtension: locator supports Statement (#294)

changes

  • Resolver: only optional parameters are autowired with default value (BC break)
  • generated accessors/factories must have defined return type (BC break)
  • %parameters% is deprecated (BC break)
  • LocatorDefinition: deprecated support for create($name) method (BC break)
  • PhpGenerator: warns about suspicious dumping of objects
v3.1.10
  • ParametersExtension: exports both statements and dynamic parameters, preloads only the latter
  • allowed %foo.bar% expansion of Statement
  • SearchExtension: also searches for accessors
  • Resolver::autowireArgument() fixed handling of new-initializer with typehint #302
  • InjectExtension: added type checking
  • NeonAdapter::removeUnderscoreVisitor() checks if key doesn't exist
v3.1.8
  • ParametersExtension, Container: redesigned way of exporting dynamic parameters via getParameter() #291
  • Helpers::expand() allow concatenation of Statements #288
  • more self explanatory message for factory and service mismatch (closes #199) (#284)
  • Support list<Type> syntax for autowiring a collection of services (#293)
  • Resolver: added support for named variadics #289
  • ParametersExtension: better validation exception for dynamic parameters
  • ContainerPanel: refactoring
  • Container: detects circular reference for parameters
  • ServiceDefinition: prepends [@self](https://github.com/self) to setup immediately
  • Option 'class' is allowed again
v3.0.17
  • Resolver: added support for named variadics #289
  • Resolver: tolerates nullable types when resolving
  • Container: added initialize()
v3.1.3
  • support for PHP 8.3
  • Resolver: tolerates nullable types when resolving
v3.1.2
  • ContainerPanel: removed padding & word-break for dumps, class name moved to the top and removed from the header
  • Resolver::autowireArguments() fixed support for variadics
  • fixed exception messages
  • fix Container::getByType() compatibility with PHPStan (#285)
v3.0.16
  • ContainerPanel: removed padding & word-break for dumps
  • Resolver::autowireArguments() fixed support for variadics
  • fixed exception messages

v3.0 maintenance has been ended, please update to v 3.1

v3.1.1
  • better exception messages
  • Container: added typehint object
  • composer: accepts nette/utils & robot-loader 4.0
  • removed Adapter::dump() interface method
v3.0.15
  • revert "used generics (#261)" [Closes #274]
  • improved exception messages
v3.1.0

Changes:

  • supports PascalCase constants in configuration
  • Resolver: non-optional autowired parameters trigger notice that value is required [Closes #271]
  • constants are PascalCase
  • NeonAdapter: automatically escapes @
  • Compiler: constants are evaluated immediately"

Deprecations:

  • deprecated options 'parameters', 'dynamic', 'class' (instead of 'type') in configuration
  • Three ... dots are deprecated in configuration
  • Loader::save() is deprecated
  • annotations [@return](https://github.com/return) are deprecated
  • PhpExtension & ConstantsExtension are deprecated (have been moved to nette/bootstrap)
v3.0.14
  • support for PHP 8.2
  • ExtensionsExtension: removed final #280
  • Revert "ContainerLoader: mutex handling clarification (#270)"
v3.0.13
  • private constants are PascalCase
  • Resolver: autowiring of collection supports 'array`<int,T>`` annotation #277
  • composer: updated dependencies
  • DefinitionSchema: recognizes Locator with one service #276
v3.0.12
  • Resolver::resolveEntityType() ignores return types 'object' & 'mixed' #274
  • Resolver::autowireArgument() uses named arguments to skip optional parameters in PHP 8
  • Resolver: forbidden to use extra parameter after optional (for forward compatibility) (BC break)
  • Resolver::autowireArguments() improved support for variadics
  • Resolver: refactoring of autowireArguments()
  • ServicesExtension: improved parameter merging method
  • DependencyChecker: do not serialize object parameters #273
  • PhpGenerator: do not format the statement twice or incorrectly
  • improved exception messages
  • improved coding style
  • ServiceDefinition: added setCreator() & getCreator(), aliases for setFactory() & getFactory()
v3.0.11
  • The _ are removed using Neon visitor #264 (requires neon/neon 3.3)
  • InjectExtension: warns on non-public, static or readonly properties
  • ServiceDefinition: type checking removed, because methods have a type defined
  • FactoryDefinition: fixed notice #266
  • Partially reverts "improved phpDoc, used generics (#261)" #263
  • Revert "Resolver::autowireArguments() throws an exception when combining a named and positional parameter" #265
v3.0.10
  • added _ as alias for ... in config
  • FactoryDefinition: added support for syntax $params in definition
  • added 'create' as alias for 'factory'
  • Resolver::autowireArguments() throws an exception when combining a named and positional parameter
  • DefinitionSchema: better exception on empty definition
  • FactoryDefinition::resolveType() checks for type compatibility
  • Resolver::completeException() truncates but does not remove the class name
  • Unified type validation using Helper::ensureClassType()
  • replaced use of Reflection::getReturnTypes() etc
  • uses nette/utils 3.1.6
  • improved phpDoc, used generics (#261)
v3.0.9
  • support for PHP 8.1
  • improved error messages
  • added support for enums in config file
  • support for intersection type
  • Revert "uses nette/utils 3.2" to maintain compatibility with PHP 7.1
v3.0.8
  • Resolver: handles nullable or default union|types
  • ContainerPanel: better sorting for human eyes
  • ContainerPanel: shows names of anonymous services
  • uses nette/utils 3.2
v3.0.7
  • Compiler: triggers schema warnings
  • uses nette/schema 1.1
  • DecoratorExtension: throws exception if class not exists
v2.4.17

compatible with PHP 8.0

v3.0.6
  • added PHP 8 attribute Inject
  • cooperation with union types
  • Resolver::completeException() appends entity to exception message when type is not known
  • DependencyChecker: checks types of properties
  • DependencyChecker: fixed compatibility with PHP 8 #247
  • DIExtension: detects Tracy by presence of service @Tracy\Bar #245
  • InjectExtension: updated exception messages

For the details you can have a look at the diff.

v3.0.5
  • compatible with PHP 8.0
  • added new internal functions bool(), int(), float(), string()
  • added Helpers::escape()
  • improved exception messages

For the details you can have a look at the diff.

v3.0.4
  • Resolver: fixed self-dependency #240
  • InjectExtension: chooses a more specific type #234
  • SearchExtension: Exception when class is not autoloaded.
  • DecoratorExtension: resolves definitions before uses its findByType()
  • Container: added getByName() as alias for getService()
  • Compiler: moved Search extension before Decorator (#197)
  • Resolver: better exception message (#233)
  • InjectExtension: maintains natural order of inject methods (BC break)

For the details you can have a look at the diff.

v3.0.3
  • CompilerExtension: added $initialization as replacement for modifying initialize() method
  • class aliases are loaded on demand #226
  • Statement: can be used as dynamic parameter #228
  • parameters: dynamic parameters are resolved
  • parameters: statements are replaced with null in Container
  • %parameters% resolves to all parameters
  • Revert "parameters can contain statements #221"
  • ContainerPanel: uses capturing

For the details you can have a look at the diff.

v3.0.2
  • InjectExtension: accepts native type
  • parameters can contain statements #221
  • InjectExtension: scans resolved class #218
  • SearchExtension: removes conflicting services before it starts to add them
  • Resolver.autowireArguments() fixed counting optional args
  • Resolver::autowireArguments() refactoring, added autowireArgument(), Resolver|Container replaced with callback
  • ExtensionsExtension: better exception message #219

For the details you can have a look at the diff.

v2.4.16
  • supports PHP 7.4
  • Helpers::expand() fixed expansion of dynamic parameters

For the details you can have a look at the diff.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope