0 follower

Final Class Yiisoft\Yii\Console\Application

InheritanceYiisoft\Yii\Console\Application » Symfony\Component\Console\Application

Protected Methods

Hide inherited methods

Method Description Defined By
doRenderThrowable() Yiisoft\Yii\Console\Application

Constants

Hide inherited constants

Constant Value Description Defined By
NAME 'Yii Console' Yiisoft\Yii\Console\Application
VERSION '1.0' Yiisoft\Yii\Console\Application

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string $name self::NAME, string $version self::VERSION )
$name string
$version string

                public function __construct(string $name = self::NAME, string $version = self::VERSION)
{
    parent::__construct($name, $version);
}

            
addOptions() public method

public void addOptions ( \Symfony\Component\Console\Input\InputOption $options )
$options \Symfony\Component\Console\Input\InputOption

                public function addOptions(InputOption $options): void
{
    $this
        ->getDefinition()
        ->addOption($options);
}

            
doRenderThrowable() protected method

protected void doRenderThrowable ( Throwable $e, \Symfony\Component\Console\Output\OutputInterface $output )
$e Throwable
$output \Symfony\Component\Console\Output\OutputInterface

                protected function doRenderThrowable(Throwable $e, OutputInterface $output): void
{
    parent::doRenderThrowable($e, $output);
    // Friendly Exception support
    if ($e instanceof FriendlyExceptionInterface) {
        if ($output instanceof StyleInterface) {
            $output->title($e->getName());
            if (($solution = $e->getSolution()) !== null) {
                $output->note($solution);
            }
            $output->newLine();
        } else {
            $output->writeln('<fg=red>' . $e->getName() . '</>');
            if (($solution = $e->getSolution()) !== null) {
                $output->writeln('<fg=yellow>' . $solution . '</>');
            }
            $output->writeln('');
        }
    }
    $output->writeln($e->getTraceAsString());
}

            
extractNamespace() public method

public string extractNamespace ( string $name, integer|null $limit null )
$name string
$limit integer|null

                public function extractNamespace(string $name, ?int $limit = null): string
{
    return parent::extractNamespace(str_replace('/', ':', $name), $limit);
}

            
getNamespaces() public method

public array getNamespaces ( )

                public function getNamespaces(): array
{
    $namespaces = [];
    foreach ($this->all() as $command) {
        if ($command->isHidden()) {
            continue;
        }
        $namespaces[] = $this->extractAllNamespaces($command->getName());
        /** @var string $alias */
        foreach ($command->getAliases() as $alias) {
            $namespaces[] = $this->extractAllNamespaces($alias);
        }
    }
    return array_values(array_unique(array_filter(array_merge([], ...$namespaces))));
}

            
renderThrowable() public method

public void renderThrowable ( Throwable $e, \Symfony\Component\Console\Output\OutputInterface $output )
$e Throwable
$output \Symfony\Component\Console\Output\OutputInterface

                public function renderThrowable(Throwable $e, OutputInterface $output): void
{
    $output->writeln('', OutputInterface::VERBOSITY_QUIET);
    $this->doRenderThrowable($e, $output);
}

            
setDispatcher() public method

public void setDispatcher ( \Symfony\Contracts\EventDispatcher\EventDispatcherInterface $dispatcher )
$dispatcher \Symfony\Contracts\EventDispatcher\EventDispatcherInterface

                public function setDispatcher(EventDispatcherInterface $dispatcher): void
{
    $this->dispatcher = $dispatcher;
    parent::setDispatcher($dispatcher);
}

            
shutdown() public method

public void shutdown ( integer $exitCode )
$exitCode integer

                public function shutdown(int $exitCode): void
{
    if ($this->dispatcher !== null) {
        $this->dispatcher->dispatch(new ApplicationShutdown($exitCode));
    }
}

            
start() public method

public void start ( \Symfony\Component\Console\Input\ArgvInput|null $input null )
$input \Symfony\Component\Console\Input\ArgvInput|null

                public function start(?ArgvInput $input = null): void
{
    if ($this->dispatcher !== null && $input !== null) {
        $this->dispatcher->dispatch(new ApplicationStartup($input->getFirstArgument()));
    }
}