Download the PHP package pollen-solutions/argument-resolver without Composer
On this page you can find all versions of the php package pollen-solutions/argument-resolver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pollen-solutions/argument-resolver
More information about pollen-solutions/argument-resolver
Files in pollen-solutions/argument-resolver
Package argument-resolver
Short Description Pollen Solutions - Argument Resolve Component - Smart arguments resolving of callable
License MIT
Homepage https://www.presstify.com/pollen-solutions/argument-resolver/
Informations about the package argument-resolver
Argument Resolver Component
Pollen Solutions Argument Resolver Component is a smart arguments resolving of callable library. It allows you to dynamically determine the arguments to pass to a function, an invokable class or a method.
Installation
Basic Usage
In below example, callable is a closure function.
It could be a class method :
Also, it could be an invokable class :
Resolvers
ParameterResolver
-- @todo or see below --
ContainerResolver
The container resolver is used to resolve the arguments of a callable provided by a container that implements \Psr\Container\ContainerInterface.
RequestResolver
The request resolver is used to resolve arguments of a callable provided by an HTTP request that implements Psr\Http\Message\ServerRequestInterface.
RequestAttributeResolver
The request attribute attribute resolver is used to resolve arguments of a callable provided through attributes of an HTTP request that implements Psr\Http\Message\ServerRequestInterface.
Chained resolvers
Create a custom resolver
You can create your own custom resolver. In this example, we are creating an HTTP request session based resolver. To works, a resolver must implements Pollen\ArgumentResolver\ResolverInterface.
Credits
- Freely inspired by Rybakit work in ArgumentsResolver