Repository: symfony/symfony
File: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php (PHP)

Code before:
            return 'NONE';
        }

        ksort($config);

        $configAsString = '';
        foreach ($config as $key => $value) {
            $configAsString .= \sprintf("\n%s: %s", $key, $this->formatValue($value));
        }

        return trim($configAsString);
    }

    /**
     * @param array<string> $methods
     */
    private function formatMethods(array $methods): string
    {
        if (count($methods) === 0) {
            $methods = ['ANY'];
        }

        return implode('|', array_map(
            fn (string $method): string => sprintf('<fg=%s>%s</>', self::VERB_COLORS[$method] ?? 'default', $method),
            $methods
        ));
    }

    /**
     * @param (callable():ContainerBuilder)|null $getContainer
     */
    private function formatControllerLink(mixed $controller, string $anchorText, ?callable $getContainer = null): string
    {
        if (null === $this->fileLinkFormatter) {
            return $anchorText;
        }

        try {
            if (null === $controller) {
                return $anchorText;
            } elseif (\is_array($controller)) {
                $r = new \ReflectionMethod($controller[0], $controller[1]);
            } elseif ($controller instanceof \Closure) {
                $r = new \ReflectionFunction($controller);
            } elseif (method_exists($controller, '__invoke')) {
                $r = new \ReflectionMethod($controller, '__invoke');
            } elseif (!\is_string($controller)) {
                return $anchorText;
            } elseif (str_contains($controller, '::')) {
                $r = new \ReflectionMethod(...explode('::', $controller, 2));
            } else {

Review comment (suggestion):
```suggestion
        return implode('|', array_map(
            fn (string $method): string => sprintf('<fg=%s>%s</>', self::VERB_COLORS[$method] ?? 'default', $method),
            $methods ?: ['ANY']
```


Code after:
        if (!$config) {
            return 'NONE';
        }

        ksort($config);

        $configAsString = '';
        foreach ($config as $key => $value) {
            $configAsString .= \sprintf("\n%s: %s", $key, $this->formatValue($value));
        }

        return trim($configAsString);
    }

    /**
     * @param array<string> $methods
     */
    private function formatMethods(array $methods): string
    {
        if ([] === $methods) {
            $methods = ['ANY'];
        }

        return implode('|', array_map(
            fn (string $method): string => \sprintf('<fg=%s>%s</>', self::VERB_COLORS[$method] ?? 'default', $method),
            $methods
        ));
    }

    /**
     * @param (callable():ContainerBuilder)|null $getContainer
     */
    private function formatControllerLink(mixed $controller, string $anchorText, ?callable $getContainer = null): string
    {
        if (null === $this->fileLinkFormatter) {
            return $anchorText;
        }

        try {
            if (null === $controller) {
                return $anchorText;
            } elseif (\is_array($controller)) {
                $r = new \ReflectionMethod($controller[0], $controller[1]);
            } elseif ($controller instanceof \Closure) {
                $r = new \ReflectionFunction($controller);
            } elseif (method_exists($controller, '__invoke')) {
                $r = new \ReflectionMethod($controller, '__invoke');
            } elseif (!\is_string($controller)) {
                return $anchorText;
            } elseif (str_contains($controller, '::')) {
                $r = new \ReflectionMethod(...explode('::', $controller, 2));