private static function processTag(BaseTag $tag)
    {
        $types = [];

        if (method_exists($tag, 'getType') && is_callable([$tag, 'getType'])) {
            if (($type = $tag->getType()) !== null) {
                $types[] = $type;
            }
        }

        if (method_exists($tag, 'getArguments') && is_callable([$tag, 'getArguments'])) {
            foreach ($tag->getArguments() as $param) {
                if (($type = $param['type'] ?? null) !== null) {
                    $types[] = $type;
                }
            }
        }

        return $types;
    }