Repository: laravel/framework
File: src/Illuminate/Foundation/Console/AboutCommand.php (PHP)

Code before:
                        console: fn ($value) => '<fg=yellow;options=bold>'.$value.'</> <fg=gray;options=bold>/</> '.$secondary->implode(', '),
                        json: fn () => $secondary->all(),
                    ), $json);
                } else {
                    $logs = $logChannel;
                }

                return $logs;
            },
            'Mail' => config('mail.default'),
            'Octane' => config('octane.server'),
            'Queue' => config('queue.default'),
            'Scout' => config('scout.driver'),
            'Session' => config('session.driver'),
        ]));

        static::addToSection('Storage', fn () => [
            ...$this->determineStoragePathLinkStatus($formatStorageLinkedStatus),
        ]);

        (new Collection(static::$customDataResolvers))->each->__invoke();
    }

    /**
     * Determine storage symbolic links status.
     *
     * @param  callable  $formatStorageLinkedStatus
     * @return array<string,mixed>
     */
    protected function determineStoragePathLinkStatus(callable $formatStorageLinkedStatus): array
    {
        return (new Collection(config('filesystems.links', [])))
            ->mapWithKeys(function ($target, $link) use ($formatStorageLinkedStatus) {
                $path = Str::replace(public_path(), '', $link);

                return [public_path($path) => static::format(file_exists($link), console: $formatStorageLinkedStatus)];
            })
            ->toArray();
    }

    /**
     * Determine whether the given directory has PHP files.
     *
     * @param  string  $path
     * @return bool
     */
    protected function hasPhpFiles(string $path): bool
    {
        return count(glob($path.'/*.php')) > 0;
    }


Review comment (performance):
Technically, we could extract this logic into a separate method, so that we can reuse it here as well as for the `'Cache'` and the `'Logs'` case above.

Code after:
                        console: fn ($value) => '<fg=yellow;options=bold>'.$value.'</> <fg=gray;options=bold>/</> '.$secondary->implode(', '),
                        json: fn () => $secondary->all(),
                    ), $json);
                } else {
                    $logs = $logChannel;
                }

                return $logs;
            },
            'Mail' => config('mail.default'),
            'Octane' => config('octane.server'),
            'Queue' => function ($json) {
                $queueConnection = config('queue.default');

                if (config('queue.connections.'.$queueConnection.'.driver') === 'failover') {
                    $secondary = new Collection(config('queue.connections.'.$queueConnection.'.connections'));

                    return value(static::format(
                        value: $queueConnection,
                        console: fn ($value) => '<fg=yellow;options=bold>'.$value.'</> <fg=gray;options=bold>/</> '.$secondary->implode(', '),
                        json: fn () => $secondary->all(),
                    ), $json);
                }

                return $queueConnection;
            },
            'Scout' => config('scout.driver'),
            'Session' => config('session.driver'),
        ]));

        static::addToSection('Storage', fn () => [
            ...$this->determineStoragePathLinkStatus($formatStorageLinkedStatus),
        ]);

        (new Collection(static::$customDataResolvers))->each->__invoke();
    }

    /**
     * Determine storage symbolic links status.
     *
     * @param  callable  $formatStorageLinkedStatus
     * @return array<string,mixed>
     */
    protected function determineStoragePathLinkStatus(callable $formatStorageLinkedStatus): array
    {
        return (new Collection(config('filesystems.links', [])))
            ->mapWithKeys(function ($target, $link) use ($formatStorageLinkedStatus) {
                $path = Str::replace(public_path(), '', $link);

                return [public_path($path) => static::format(file_exists($link), console: $formatStorageLinkedStatus)];
            })