Copied!
CloneableInstantiable
Methods
public Symfony\Component\Console\Application::__construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN')
public Symfony\Component\Console\Application::add(Symfony\Component\Console\Command\Command $command) : ?Symfony\Component\Console\Command\Command
 

Adds a command object.

If a command with the same name already exists, it will be overridden. If the command is not enabled it will not be added.

public Symfony\Component\Console\Application::addCommands(array $commands) : void
 

Adds an array of command objects.

If a Command is not enabled it will not be added.

  • param \Command[] $commands An array of commands
public Symfony\Component\Console\Application::all(?string $namespace = NULL) : array
 

Gets the commands (registered in the given namespace if provided).

The array keys are the full names and the values the command instances.

  • return \Command[]
public Symfony\Component\Console\Application::areExceptionsCaught() : bool
 

Gets whether to catch exceptions or not during commands execution.

public Symfony\Component\Console\Application::complete(Symfony\Component\Console\Completion\CompletionInput $input, Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
 

Adds suggestions to $suggestions for the current completion input (e.g. option or argument).

public Symfony\Component\Console\Application::doRun(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) : int
 

Runs the current application.

  • return int 0 if everything went fine, or an error code
public Symfony\Component\Console\Application::extractNamespace(string $name, ?int $limit = NULL) : string
 

Returns the namespace part of the command name.

This method is not part of public API and should not be used directly.

public Symfony\Component\Console\Application::find(string $name) : Symfony\Component\Console\Command\Command
 

Finds a command by name or alias.

Contrary to get, this command tries to find the best match if you give it an abbreviation of a name or alias.

  • throws \CommandNotFoundException When command name is incorrect or ambiguous
public Symfony\Component\Console\Application::findNamespace(string $namespace) : string
 

Finds a registered namespace by a name or an abbreviation.

  • throws \NamespaceNotFoundException When namespace is incorrect or ambiguous
public Symfony\Component\Console\Application::get(string $name) : Symfony\Component\Console\Command\Command
 

Returns a registered command by name or alias.

  • throws \CommandNotFoundException When given command name does not exist
public static Symfony\Component\Console\Application::getAbbreviations(array $names) : array
 

Returns an array of possible abbreviations given a set of names.

  • return string[][]
public Symfony\Component\Console\Application::getAlarmInterval() : ?int
 

Gets the interval in seconds on which a SIGALRM signal is dispatched.

public Symfony\Component\Console\Application::getDefinition() : Symfony\Component\Console\Input\InputDefinition
 

Gets the InputDefinition related to this Application.

public getHelp() : string
 
public Symfony\Component\Console\Application::getHelperSet() : Symfony\Component\Console\Helper\HelperSet
 

Get the helper set associated with the command.

public Symfony\Component\Console\Application::getLongVersion() : string
 

Returns the long version of the application.

public Symfony\Component\Console\Application::getName() : string
 

Gets the name of the application.

public Symfony\Component\Console\Application::getNamespaces() : array
 

Returns an array of all unique namespaces used by currently registered commands.

It does not return the global namespace which always exists.

  • return string[]
public Symfony\Component\Console\Application::getSignalRegistry() : Symfony\Component\Console\SignalRegistry\SignalRegistry
public Symfony\Component\Console\Application::getVersion() : string
 

Gets the application version.

public Symfony\Component\Console\Application::has(string $name) : bool
 

Returns true if the command exists, false otherwise.

public Symfony\Component\Console\Application::isAutoExitEnabled() : bool
 

Gets whether to automatically exit after a command execution or not.

public Symfony\Component\Console\Application::isSingleCommand() : bool
 
  • internal
public Symfony\Component\Console\Application::register(string $name) : Symfony\Component\Console\Command\Command
 

Registers a new command.

public Symfony\Component\Console\Application::renderThrowable(Throwable $e, Symfony\Component\Console\Output\OutputInterface $output) : void
public Symfony\Component\Console\Application::reset() : void
public run(?Symfony\Component\Console\Input\InputInterface $input = NULL, ?Symfony\Component\Console\Output\OutputInterface $output = NULL) : int
 
  • return int 0 if everything went fine, or an error code
  • throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}.
public Symfony\Component\Console\Application::setAlarmInterval(?int $seconds) : void
 

Sets the interval to schedule a SIGALRM signal in seconds.

public Symfony\Component\Console\Application::setAutoExit(bool $boolean) : void
 

Sets whether to automatically exit after a command execution or not.

public Symfony\Component\Console\Application::setCatchErrors(bool $catchErrors = true) : void
 

Sets whether to catch errors or not during commands execution.

public Symfony\Component\Console\Application::setCatchExceptions(bool $boolean) : void
 

Sets whether to catch exceptions or not during commands execution.

public Symfony\Component\Console\Application::setCommandLoader(Symfony\Component\Console\CommandLoader\CommandLoaderInterface $commandLoader) : void
public Symfony\Component\Console\Application::setDefaultCommand(string $commandName, bool $isSingleCommand = false) : static
 

Sets the default Command name.

  • return $this
public Symfony\Component\Console\Application::setDefinition(Symfony\Component\Console\Input\InputDefinition $definition) : void
public Symfony\Component\Console\Application::setDispatcher(Symfony\Contracts\EventDispatcher\EventDispatcherInterface $dispatcher) : void
 
  • final
public Symfony\Component\Console\Application::setHelperSet(Symfony\Component\Console\Helper\HelperSet $helperSet) : void
public Symfony\Component\Console\Application::setName(string $name) : void
 

Sets the application name.

public Symfony\Component\Console\Application::setSignalsToDispatchEvent(int $signalsToDispatchEvent) : void
public Symfony\Component\Console\Application::setVersion(string $version) : void
 

Sets the application version.

Methods
protected Symfony\Component\Console\Application::configureIO(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) : void
 

Configures the input and output instances based on the user arguments and options.

protected Symfony\Component\Console\Application::doRenderThrowable(Throwable $e, Symfony\Component\Console\Output\OutputInterface $output) : void
protected Symfony\Component\Console\Application::doRunCommand(Symfony\Component\Console\Command\Command $command, Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) : int
 

Runs the current command.

If an event dispatcher has been attached to the application, events are also dispatched during the life-cycle of the command.

  • return int 0 if everything went fine, or an error code
protected Symfony\Component\Console\Application::getCommandName(Symfony\Component\Console\Input\InputInterface $input) : ?string
 

Gets the name of the command based on input.

protected Symfony\Component\Console\Application::getDefaultCommands() : array
 

Gets the default commands that should always be available.

  • return \Command[]
protected Symfony\Component\Console\Application::getDefaultHelperSet() : Symfony\Component\Console\Helper\HelperSet
 

Gets the default helper set with the helpers that should always be available.

protected Symfony\Component\Console\Application::getDefaultInputDefinition() : Symfony\Component\Console\Input\InputDefinition
 

Gets the default input definition.

Properties
private $logo = ' ________ __ .__ / _____/ ____ _____/ |_ ____ ____ | | ______ / \ ____/ __ \/ _ \ __\/ _ \ / _ \| | / ___/ \ \_\ \ ___( <_> ) | ( <_> | <_> ) |__\___ \ \______ /\___ >____/|__| \____/ \____/|____/____ > \/ \/ \/ '
 
  • var string
Methods
public static Symfony\Component\Console\Application::getAbbreviations(array $names) : array
 

Returns an array of possible abbreviations given a set of names.

  • return string[][]
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration