2017 © Pedro Peláez
 

library type-validator

TypeValidator for asserting types of values

image

mf/type-validator

TypeValidator for asserting types of values

  • Thursday, July 19, 2018
  • by MortalFlesh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3,724 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 53 % Grown

The README.md

TypeValidator

Latest Stable Version Tests and linting Coverage Status Total Downloads License, (*1)

TypeValidator for asserting types of values, (*2)

Table of Contents

Requirements

  • PHP 8.0

Installation:

composer require mf/type-validator

Usage

$validator = new TypeValidator(
    TypeValidator::TYPE_STRING,
    TypeValidator::TYPE_INT,
    [TypeValidator::TYPE_STRING],
    [TypeValidator::INT]
);

$validator->assertKeyType('string - value');
$validator->assertValueType(1);

$validator->assertValueType('invalid value type');  // throws InvalidArgumentException

With Custom Exception

$validator = new TypeValidator(
    TypeValidator::TYPE_STRING,
    TypeValidator::TYPE_INT,
    [TypeValidator::TYPE_STRING],
    [TypeValidator::INT],
    App\MyCustomException::class
);

$validator->assertKeyType('string - value');
$validator->assertValueType(1);

$validator->assertValueType('invalid value type');  // throws App\MyCustomException

The Versions

19/07 2018

dev-master

9999999-dev

TypeValidator for asserting types of values

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Petr Chromec

19/07 2018

2.2.0

2.2.0.0

TypeValidator for asserting types of values

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Petr Chromec

19/07 2018

dev-feature/allow-any-type

dev-feature/allow-any-type

TypeValidator for asserting types of values

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Petr Chromec

19/07 2018

dev-feature/update-dev-dependencies

dev-feature/update-dev-dependencies

TypeValidator for asserting types of values

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Petr Chromec

09/08 2017

2.1.0

2.1.0.0

TypeValidator for asserting types of values

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Petr Chromec

16/06 2017

2.0.0

2.0.0.0

TypeValidator for asserting types of values

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Petr Chromec

05/09 2016

1.0.0

1.0.0.0

TypeValidator for asserting types of values

  Sources   Download

MIT

The Requires

  • php >=5.5 || >=7.0

 

The Development Requires

by Petr Chromec