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 __construct( string $name self::NAME, string $version self::VERSION ): mixed
$name string
$version string

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

            
addOptions() public method

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

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

            
doRenderThrowable() protected method

protected doRenderThrowable( Throwable $e, \Symfony\Component\Console\Output\OutputInterface $output ): void
$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 extractNamespace( string $name, integer|null $limit null ): string
$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 getNamespaces( ): array

                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 renderThrowable( Throwable $e, \Symfony\Component\Console\Output\OutputInterface $output ): void
$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 setDispatcher( \Symfony\Contracts\EventDispatcher\EventDispatcherInterface $dispatcher ): void
$dispatcher \Symfony\Contracts\EventDispatcher\EventDispatcherInterface

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

            
shutdown() public method

public shutdown( integer $exitCode ): void
$exitCode integer

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

            
start() public method

public start( \Symfony\Component\Console\Input\ArgvInput|null $input null ): void
$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()));
    }
}