Download the PHP package rybakit/arguments-resolver without Composer
On this page you can find all versions of the php package rybakit/arguments-resolver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rybakit/arguments-resolver
More information about rybakit/arguments-resolver
Files in rybakit/arguments-resolver
Package arguments-resolver
Short Description ArgumentsResolver allows you to determine the arguments to pass to a function or method.
License MIT
Homepage https://github.com/rybakit/arguments-resolver
Informations about the package arguments-resolver
ArgumentsResolver
ArgumentsResolver allows you to determine the arguments to pass to a function or method.
Installation
The recommended way to install ArgumentsResolver is through Composer:
Usage example
The above example will output:
Resolvers
The library ships with two resolvers, the NamedArgumentsResolver. They both expect a function to be supplied as a single constructor argument. The function can be any callable, a string representing a class method or an instance of ReflectionFunctionAbstract:
There is also an utility class which helps in creating a reflection instance:
InDepthArgumentsResolver
In the InDepthArgumentsResolver
, the decision about whether an argument matched the parameter value or not
is influenced by multiple factors, namely the argument's type, the class hierarchy (if it's an object),
the argument name and the argument position.
To clarify, consider each circumstance in turn:
Argument type
Class hierarchy
Argument name
Argument position
NamedArgumentsResolver
The NamedArgumentsResolver
is a very simple resolver which does the matching only by the argument name.
Therefore this requires parameters to be an associative array:
Tests
ArgumentsResolver uses PHPUnit for unit testing. In order to run the tests, you'll first need to setup the test suite using composer:
You can then run the tests:
License
ArgumentsResolver is released under the MIT License. See the bundled LICENSE file for details.