2017 © Pedro Peláez
 

library saxulum-hint

Saxulum Hint

image

saxulum/saxulum-hint

Saxulum Hint

  • Saturday, November 28, 2015
  • by dominikzogg
  • Repository
  • 1 Watchers
  • 0 Stars
  • 522 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

saxulum-hint

Build Status Total Downloads Latest Stable Version Scrutinizer Code Quality, (*1)

Features

  • Hint scalars, arrays and objects

Requirements

  • PHP 5.3+

Installation

Through Composer as saxulum/saxulum-hint., (*2)

Usage

Without a hint

``` {.php} Hint::validate(false) // true Hint::validate(true) // true Hint::validate(1) // true Hint::validate(1.0) // true Hint::validate('1.0') // true Hint::validate('test') // true Hint::validate(array()) // true Hint::validate(new \stdClass) // true, (*3)


#### Hint boolean ``` {.php} Hint::validate(null, Hint::BOOL) // true Hint::validate(true, Hint::BOOL) // true Hint::validate(null, Hint::BOOL, false) // false

Hint int

``` {.php} Hint::validate(null, Hint::INT) // true Hint::validate(1, Hint::INT) // true Hint::validate(null, Hint::INT, false) // false, (*4)


#### Hint float ``` {.php} Hint::validate(null, Hint::FLOAT) // true Hint::validate(1.0, Hint::FLOAT) // true Hint::validate(null, Hint::FLOAT, false) // false

Hint numeric

``` {.php} Hint::validate(null, Hint::NUMERIC) // true Hint::validate('1.0', Hint::NUMERIC) // true Hint::validate(null, Hint::NUMERIC, false) // false, (*5)


#### Hint string ``` {.php} Hint::validate(null, Hint::STRING) // true Hint::validate('name', Hint::STRING) // true Hint::validate(null, Hint::STRING, false) // false

Hint array

``` {.php} Hint::validate(null, Hint::ARR) // false Hint::validate(array, Hint::ARR) // true Hint::validate(null, Hint::ARR, true) // true, (*6)


#### Hint object ``` {.php} Hint::validate(null, '\stdClass') // false Hint::validate(new \stdClass, '\stdClass') // true Hint::validate(null, '\stdClass', true) // true

Hint array/collection values

{.php} Hint::validate(array(), Hint::BOOL . '[]') // true Hint::validate(array(true, false), Hint::BOOL . '[]') // true Hint::validate(array(true, null), Hint::BOOL . '[]') // true Hint::validate(array('\stdClass', '\stdClass'), '\stdClass[]') // true Hint::validate(array('\stdClass', null), '\stdClass[]') // false Hint::validate(array('\stdClass', null), '\stdClass[]', true) // true Hint::validate(array('\stdClass', 'test'), '\stdClass[]', true) // false, (*7)

The Versions

28/11 2015

dev-master

9999999-dev

Saxulum Hint

  Sources   Download

MIT

The Requires

  • php >=5.3,<8.0

 

The Development Requires

by Dominik Zogg

hint saxulum

28/09 2014

1.0.0

1.0.0.0

Saxulum Hint

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Dominik Zogg

hint saxulum