dhii / args-list-validation
Validation of an arguments list
Installs: 3 824
Dependents: 5
Suggesters: 1
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^5.4 | ^7.0
Requires (Dev)
- codeclimate/php-test-reporter: <=0.3.2
- dhii/php-cs-fixer-config: ^0.1
- dhii/stringable-interface: ^0.1
- phpunit/phpunit: ^4.8
- ptrofimov/xpmock: ^1.1
This package is auto-updated.
Last update: 2024-12-07 04:52:51 UTC
README
Details
This package contains functionality for validation of a list of values against a specification. Currently, this
specification is accepted in the form of a list of ReflectionParameter
criteria, which is
typically retrieved via ReflectionFunctionAbstract#getParameters()
.
Thus, it is possible to validate a list of arguments to determine whether any function or method can be invoked with
it - without actually invoking.
It is also possible to use functionality in this package to determine whether any individual value matches a type
criterion in the form of a ReflectionType
, which is typically retrieved via
ReflectionParameter#getType()
.
Traits
GetArgsListErrorsCapableTrait
- Produces a list of reasons for an args list being invalid against a param spec.GetValueTypeErrorCapableTrait
- Produces a reason for a value being invalid against a type criteria.