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);
    }