src/Assert.php
public static function type($value, $choices, $keyword, $pointer)
    {
        $actualType = gettype($value);
        $choices    = is_array($choices)  ? $choices : [$choices];

        if (in_array($actualType, $choices) ||
            (is_json_number($value) && in_array('number', $choices))) {
            return;
        }

        throw InvalidSchemaException::invalidParameterType(
            $actualType,
            $choices,
            $keyword,
            $pointer
        );
    }
public static function type($value, $choices, $keyword, $pointer)
    {
        $actualType = gettype($value);
        $choices    = is_array($choices)  ? $choices : [$choices];

        if (in_array($actualType, $choices) ||
            (is_json_number($value) && in_array('number', $choices))) {
            return;
        }

        throw InvalidSchemaException::invalidParameterType(
            $actualType,
            $choices,
            $keyword,
            $pointer
        );
    }
public static function type ( $ value , $ choices , $ keyword , $ pointer ) { $ actualType = gettype ( $ value ) ; $ choices = is_array ( $ choices ) ? $ choices : [ $ choices ] ; if ( in_array ( $ actualType , $ choices ) || ( is_json_number ( $ value ) && in_array ( 'number' , $ choices ) ) ) { return ; } throw InvalidSchemaException :: invalidParameterType ( $ actualType , $ choices , $ keyword , $ pointer ) ; }
Validate a value is one of the allowed types.

@param mixed        $value
@param array|string $choices
@param string       $keyword
@param string       $pointer

@throws InvalidSchemaException
Validate a value is one of the allowed types .