romannowicki / assure
Data correction and validation
Installs: 531
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/romannowicki/assure
Requires (Dev)
- phpunit/phpunit: 4.2.*
- satooshi/php-coveralls: dev-master
- scrutinizer/ocular: dev-master
This package is not auto-updated.
Last update: 2015-07-24 18:41:26 UTC
README
Data correction and validation tools
Installation
via Composer:
"require": { "romannowicki/assure": "2.0.1" }
Usage example
// if value is not integer and cannot be transform to integer assure with throw exception // correct values: '1', 1, 1.3 // invalid values: 'a', NULL, false, array() assure($value, 'integer'); // if not integer OR string with integers separated by commas assure will throw exception // correct values: '1', '1,2,3,4,5'; // invalid values: 'a', '1,2,a,4,b'; assure($value, ['integer', 'commaSeparatedIntegers']);