public function normalizeType(string $type): string
    {
        if (strpos($type, '|') !== false) {
            $types = array_map([$this, __FUNCTION__], explode('|', $type));
            return join('|', $types);
        }

        if (substr($type, -2) === '[]') {
            $subtype = substr($type, 0, -2);
            return $this->normalizeType($subtype) . '[]';
        }

        if (ctype_alpha($type) && !ctype_lower($type) && in_array(strtolower($type), array_keys($this->handlers))) {
            $type = strtolower($type);
        }

        return $this->aliases[$type] ?? $type;
    }