Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```