Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crazyfactory/validation
Helper classes to validate inputs
https://github.com/crazyfactory/validation
Last synced: 2 months ago
JSON representation
Helper classes to validate inputs
- Host: GitHub
- URL: https://github.com/crazyfactory/validation
- Owner: crazyfactory
- Created: 2018-10-10T03:23:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T21:06:12.000Z (over 1 year ago)
- Last Synced: 2024-04-13T08:12:43.851Z (9 months ago)
- Language: PHP
- Size: 101 KB
- Stars: 2
- Watchers: 9
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Validation Helpers
This repo contains Helper classes used for various Validation tasks
## Example usage
```php
use CrazyFactory\Validation\ZipCode\Validator as ZipCodeValidator;
use CrazyFactory\Validation\ZipCode\Sanitizer as ZipCodeSanitizer;$isValidZipCode = ZipCodeValidator::isValid($zipCode, $countryCode);
// => bool$zipCode = ZipCodeSanitizer::sanitize($zipCode, $countryCode);
// => a sanitized and valid zip code (original code on failure)
```## Requirements
- php: *>7.1*
- composer installed## Scripts
Run Tests
```bash
composer test
```### Lint
```bash
composer lint
```#### Auto-fix of linting errors
```bash
composer lint:fix
```