Download the PHP package ivangrigorov/vmvalidator without Composer
On this page you can find all versions of the php package ivangrigorov/vmvalidator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ivangrigorov/vmvalidator
More information about ivangrigorov/vmvalidator
Files in ivangrigorov/vmvalidator
Package vmvalidator
Short Description Simple Request Model Validation
License MIT
Homepage https://github.com/IvanGrigorov/VMValidator
Informations about the package vmvalidator
VMValidator
Hello, this is simple attribute validation for PHP Models, based on the new features, presented in PHP 8 It works as a standalone and can be use in custom projects or in libraries like Symfony and Laravel.
Use just three rows, alogside some attributes:
Example
Installation
Options
In what order to validate the classes (methods or properties first), and what to exclude is directly configurable runtime here
Extras
- [x] Lots of validations
- [x] Supports also nested object validation
- [x] Supports also collection item types and collection item validations
- [x] Supports also custom validations*
- [x] Supports also or validations*
- [x] Nullable check
- [x] Repeatable validation attributes
- [x] Works with private properties and methods
- [x] Works with constructor promotion
- [x] Memory and time profiling
- [x] Custom error messages
- [x] Custom property and method names for the exceptions
- [x] Severity levels
- [x] Debug explorer
- [x] Callback execution*
*The custom validation should be declared as static in a validation class
The method should always return boolean: for valid input and for invalid.
In the declaration:
You can pass additional arguments to use in the validation function, but the first parameter is always the value to be tested.
*The or validation uses custom attribute names
*Callback execution
is executed on successful validation
is executed on unsuccessful validation
is executed on successful AND unsuccessful validation
Severity
Add option to make the failed validation throw NOTICE|WARNING|ERROR
Debugging
Add option to display all validations per class
Support
- Request a new validation
- Give a star
- Just say hi !