src/Helper/TypeCheck.php
public static function checkValue($value, $type)
    {
        $validator = is_callable($type) ? $type : (isset(self::$validators[$type]) ? self::$validators[$type] : null);

        if (!is_null($value)) {
            return call_user_func($validator, $value);
        }

        return false;
    }
public static function checkValue($value, $type)
    {
        $validator = is_callable($type) ? $type : (isset(self::$validators[$type]) ? self::$validators[$type] : null);

        if (!is_null($value)) {
            return call_user_func($validator, $value);
        }

        return false;
    }
Check value against the provided type

@param mixed  $value value to be checked
@param string $type  value type

@return bool