2017 © Pedro Peláez
 

library irritator

Schema-oriented assertion library

image

ztsu/irritator

Schema-oriented assertion library

  • Saturday, September 9, 2017
  • by ztsu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Ztsu\Irritator

Schema-oriented assertion libary for PHP, (*1)

Requirements

  • PHP 7.*

Install

$ composer require ztsu/irritator

Basic usage


use Ztsu\Irritator as Assert; $schema = Assert\hashmap( [ "name" => Assert\isString(), ] ); $value = [ "name" => "Test", ]; $schema->valid($value);

Assertions

Basic

  • int
  • number
  • string
  • boolean
  • list
  • hashmap
  • same
  • equal
  • regexp

Combinators

  • one of
  • null or

Numbers

  • less than
  • greater than
  • less or equal
  • greater or equal

Strings

  • email
  • url
  • phone
  • ip v4
  • ip v6
  • uuid

Dates

  • ISO 8601

Hashmap

  • required
  • one of keys

License

Irritator is licensed under the MIT License. For details see the LICENSE.md file., (*2)

The Versions

09/09 2017

dev-master

9999999-dev

Schema-oriented assertion library

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Alexey Golovnya