public static function isType($value, ?string $type): bool
    {
        if ($type === null) {
            return true;
        }

        $result = self::isSimpleType($value, $type);

        if ($result !== null) {
            return $result;
        }

        return ($value instanceof $type);
    }
public static function isType($value, ?string $type): bool
    {
        if ($type === null) {
            return true;
        }

        $result = self::isSimpleType($value, $type);

        if ($result !== null) {
            return $result;
        }

        return ($value instanceof $type);
    }
public static function isType ( $ value , ? string $ type ) : bool { if ( $ type === null ) { return true ; } $ result = self :: isSimpleType ( $ value , $ type ) ; if ( $ result !== null ) { return $ result ; } return ( $ value instanceof $ type ) ; }
Checks if value is a given type

The type can be any fully-qualified class or interface name,
or one of the following type strings:
[array, object, bool, int, float, string, callable]

@param mixed       $value The value
@param string|null $type  The type or null to accept all types

@return bool
Checks if value is a given type