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

Invoker Laravel Package

php-di/invoker

Lightweight PHP library to call any callable with automatic dependency injection. Resolves function and method parameters by name and type-hints, integrates with PHP-DI, and supports default values for flexible invocations in frameworks, controllers, and CLI tools.

View on GitHub
Deep Wiki
Context7
2.3.7
2.3.6

What's Changed

Full Changelog: https://github.com/PHP-DI/Invoker/compare/2.3.5...2.3.6

2.3.5

What's Changed

New Contributors

Full Changelog: https://github.com/PHP-DI/Invoker/compare/2.3.4...2.3.5

2.3.4

What's Changed

New Contributors

Full Changelog: https://github.com/PHP-DI/Invoker/compare/2.3.3...2.3.4

2.3.3

What's Changed

Full Changelog: https://github.com/PHP-DI/Invoker/compare/2.3.2...2.3.3

2.3.2

#36, #37, #38, #40 Improve error messages for classes implementing __callStatic()

2.3.1

#35 Allow psr/container v1|v2

2.3.0
2.2.0

Better PHP 8 support Support PHP 7.1 nullable parameters Support optional parameters before required ones (PHP-DI/PHP-DI#562)

2.1.0

PHP 8 compatibility

2.0.0

Compatibility with PSR-11 (which required a very small BC break)

1.3.3

Performance improvement: #12

1.3.2

#11 Explicit exception message for unsupported magic methods

1.3.1
  • #9 Fix exception message for callables containing objects
1.3.0
  • #8 New parameter resolver: TypeHintResolver. Resolves parameters by matching type-hints to entries in the array of parameters provided.
1.2.0

#5 The logic that resolves callable from the container has been extracted in its own class: CallableResolver.

That will allow to separately resolve callables and invoke them.

1.1.1

Improvements to exception messages

1.1.0
  • #3: support Class::method syntax for callables (by @jdreesen)
1.0.1

Big performance improvements (up to 30% faster from my benchmarks and profiling), especially for the most common use cases.

1.0.0
0.2.1

Added more specific exceptions allowing to catch them.

Also added Invoker::getContainer().

0.2.0

0.x versions do not ensure backward compatibility.

This release features mainly a new resolver ParameterNameContainerResolver. This resolver will inject container entries by searching for the name of the parameter:

$invoker->call(function ($twig) {
    // ...
});

In this example it will ->get('twig') from the container and inject it.

Breaking changes:

  • renamed AssociativeArrayParameterResolver to AssociativeArrayResolver
  • renamed DefaultValueParameterResolver to DefaultValueResolver
  • renamed NumericArrayParameterResolver to NumericArrayResolver
  • renamed ParameterResolverChain to ResolverChain
  • renamed ResolverChain::unshiftResolver() to prependResolver() and pushResolver() to appendResolver()
  • moved and renamed ContainerParameterResolver to Container\TypeHintContainerResolver
0.1.0
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport