MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/help.cafsindia.com/vendor/symfony/maker-bundle/src/Util/CliOutputHelper.php
<?php

/*
 * This file is part of the Symfony MakerBundle package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Bundle\MakerBundle\Util;

/**
 * Tools used to enhance maker command output.
 *
 * For additional context with Symfony CLI EnvVars, see
 * https://github.com/symfony-cli/symfony-cli/pull/231
 *
 * @author Jesse Rushlow <jr@rushlow.dev>
 *
 * @internal
 */
final class CliOutputHelper
{
    /**
     * EnvVars exposed by Symfony's CLI.
     */
    public const ENV_VERSION = 'SYMFONY_CLI_VERSION';       // Current CLI Version
    public const ENV_BIN_NAME = 'SYMFONY_CLI_BINARY_NAME';  // Name of the binary e.g. "symfony"

    /**
     * Get the correct command prefix based on Symfony CLI usage.
     */
    public static function getCommandPrefix(): string
    {
        $prompt = 'php bin/console';

        $binaryNameEnvVar = getenv(self::ENV_BIN_NAME);

        if (false !== $binaryNameEnvVar && false !== getenv(self::ENV_VERSION)) {
            $prompt = sprintf('%s console', $binaryNameEnvVar);
        }

        return $prompt;
    }
}