Download the PHP package germania-kg/formvalidator without Composer
On this page you can find all versions of the php package germania-kg/formvalidator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download germania-kg/formvalidator
More information about germania-kg/formvalidator
Files in germania-kg/formvalidator
Package formvalidator
Short Description Callable for validating and filtering user inputs with convenient evaluation API.
License MIT
Informations about the package formvalidator
Germania KG · FormValidator
Callable for validating and filtering user inputs with convenient evaluation API.
Installation with Composer
Form validation
The validation is done by invoking the object. The __invoke
method accepts both Arrays and Psr\Http\Message\ServerRequestInterface
instances.
Adding fields
After instantiation, you can add required or optional fields. An existing optional field is no longer optional if added using addRequired
, the same goes with required fields, if added using addOptional
.
Removing fields
After instantiation, you can remove required or optional fields.
Filtered Result: InputContainer
The InputContainer is a PSR-11 Container and also implements ArrayAccess.
ArrayAccess
Simple Array access
ContainerInterface
Filtered Result: Custom InputContainer
The FormValidator class optionally accepts a Callable that takes the filtered input. It should return something useful (such as the default InputContainer).
Variant A: Using the constructor
Variant B: Use per call
Issues
See issues list.
Development
Unit tests
Either copy phpunit.xml.dist
to phpunit.xml
and adapt to your needs, or leave as is. Run PhpUnit test or composer scripts like this:
All versions of formvalidator with dependencies
psr/log Version ^1.0
psr/container Version ^1.0
psr/http-message Version ^1.0