api/symfony/Component/Console/Application.yaml

571 lines
16 KiB
YAML
Raw Permalink Normal View History

2024-09-26 09:03:21 +00:00
name: Application
class_comment: '# * An Application is the container for a collection of commands.
# *
# * It is the main entry point of a Console application.
# *
# * This class is optimized for a standard CLI environment.
# *
# * Usage:
# *
# * $app = new Application(''myapp'', ''1.0 (stable)'');
# * $app->add(new SimpleCommand());
# * $app->run();
# *
# * @author Fabien Potencier <fabien@symfony.com>'
dependencies:
- name: Command
type: class
source: Symfony\Component\Console\Command\Command
- name: CompleteCommand
type: class
source: Symfony\Component\Console\Command\CompleteCommand
- name: DumpCompletionCommand
type: class
source: Symfony\Component\Console\Command\DumpCompletionCommand
- name: HelpCommand
type: class
source: Symfony\Component\Console\Command\HelpCommand
- name: LazyCommand
type: class
source: Symfony\Component\Console\Command\LazyCommand
- name: ListCommand
type: class
source: Symfony\Component\Console\Command\ListCommand
- name: SignalableCommandInterface
type: class
source: Symfony\Component\Console\Command\SignalableCommandInterface
- name: CommandLoaderInterface
type: class
source: Symfony\Component\Console\CommandLoader\CommandLoaderInterface
- name: CompletionInput
type: class
source: Symfony\Component\Console\Completion\CompletionInput
- name: CompletionSuggestions
type: class
source: Symfony\Component\Console\Completion\CompletionSuggestions
- name: Suggestion
type: class
source: Symfony\Component\Console\Completion\Suggestion
- name: ConsoleCommandEvent
type: class
source: Symfony\Component\Console\Event\ConsoleCommandEvent
- name: ConsoleErrorEvent
type: class
source: Symfony\Component\Console\Event\ConsoleErrorEvent
- name: ConsoleSignalEvent
type: class
source: Symfony\Component\Console\Event\ConsoleSignalEvent
- name: ConsoleTerminateEvent
type: class
source: Symfony\Component\Console\Event\ConsoleTerminateEvent
- name: CommandNotFoundException
type: class
source: Symfony\Component\Console\Exception\CommandNotFoundException
- name: ExceptionInterface
type: class
source: Symfony\Component\Console\Exception\ExceptionInterface
- name: LogicException
type: class
source: Symfony\Component\Console\Exception\LogicException
- name: NamespaceNotFoundException
type: class
source: Symfony\Component\Console\Exception\NamespaceNotFoundException
- name: RuntimeException
type: class
source: Symfony\Component\Console\Exception\RuntimeException
- name: OutputFormatter
type: class
source: Symfony\Component\Console\Formatter\OutputFormatter
- name: DebugFormatterHelper
type: class
source: Symfony\Component\Console\Helper\DebugFormatterHelper
- name: DescriptorHelper
type: class
source: Symfony\Component\Console\Helper\DescriptorHelper
- name: FormatterHelper
type: class
source: Symfony\Component\Console\Helper\FormatterHelper
- name: Helper
type: class
source: Symfony\Component\Console\Helper\Helper
- name: HelperSet
type: class
source: Symfony\Component\Console\Helper\HelperSet
- name: ProcessHelper
type: class
source: Symfony\Component\Console\Helper\ProcessHelper
- name: QuestionHelper
type: class
source: Symfony\Component\Console\Helper\QuestionHelper
- name: ArgvInput
type: class
source: Symfony\Component\Console\Input\ArgvInput
- name: ArrayInput
type: class
source: Symfony\Component\Console\Input\ArrayInput
- name: InputArgument
type: class
source: Symfony\Component\Console\Input\InputArgument
- name: InputAwareInterface
type: class
source: Symfony\Component\Console\Input\InputAwareInterface
- name: InputDefinition
type: class
source: Symfony\Component\Console\Input\InputDefinition
- name: InputInterface
type: class
source: Symfony\Component\Console\Input\InputInterface
- name: InputOption
type: class
source: Symfony\Component\Console\Input\InputOption
- name: ConsoleOutput
type: class
source: Symfony\Component\Console\Output\ConsoleOutput
- name: ConsoleOutputInterface
type: class
source: Symfony\Component\Console\Output\ConsoleOutputInterface
- name: OutputInterface
type: class
source: Symfony\Component\Console\Output\OutputInterface
- name: SignalRegistry
type: class
source: Symfony\Component\Console\SignalRegistry\SignalRegistry
- name: SymfonyStyle
type: class
source: Symfony\Component\Console\Style\SymfonyStyle
- name: ErrorHandler
type: class
source: Symfony\Component\ErrorHandler\ErrorHandler
- name: EventDispatcherInterface
type: class
source: Symfony\Contracts\EventDispatcher\EventDispatcherInterface
- name: ResetInterface
type: class
source: Symfony\Contracts\Service\ResetInterface
properties: []
methods:
- name: setDispatcher
visibility: public
parameters:
- name: dispatcher
comment: "# * An Application is the container for a collection of commands.\n# *\n\
# * It is the main entry point of a Console application.\n# *\n# * This class\
\ is optimized for a standard CLI environment.\n# *\n# * Usage:\n# *\n# * \
\ $app = new Application('myapp', '1.0 (stable)');\n# * $app->add(new SimpleCommand());\n\
# * $app->run();\n# *\n# * @author Fabien Potencier <fabien@symfony.com>\n\
# */\n# class Application implements ResetInterface\n# {\n# private array $commands\
\ = [];\n# private bool $wantHelps = false;\n# private ?Command $runningCommand\
\ = null;\n# private ?CommandLoaderInterface $commandLoader = null;\n# private\
\ bool $catchExceptions = true;\n# private bool $catchErrors = false;\n# private\
\ bool $autoExit = true;\n# private InputDefinition $definition;\n# private HelperSet\
\ $helperSet;\n# private ?EventDispatcherInterface $dispatcher = null;\n# private\
\ Terminal $terminal;\n# private string $defaultCommand;\n# private bool $singleCommand\
\ = false;\n# private bool $initialized = false;\n# private ?SignalRegistry $signalRegistry\
\ = null;\n# private array $signalsToDispatchEvent = [];\n# \n# public function\
\ __construct(\n# private string $name = 'UNKNOWN',\n# private string $version\
\ = 'UNKNOWN',\n# ) {\n# $this->terminal = new Terminal();\n# $this->defaultCommand\
\ = 'list';\n# if (\\defined('SIGINT') && SignalRegistry::isSupported()) {\n#\
\ $this->signalRegistry = new SignalRegistry();\n# $this->signalsToDispatchEvent\
\ = [\\SIGINT, \\SIGQUIT, \\SIGTERM, \\SIGUSR1, \\SIGUSR2];\n# }\n# }\n# \n# /**\n\
# * @final"
- name: setCommandLoader
visibility: public
parameters:
- name: commandLoader
comment: null
- name: getSignalRegistry
visibility: public
parameters: []
comment: null
- name: setSignalsToDispatchEvent
visibility: public
parameters:
- name: '...$signalsToDispatchEvent'
comment: null
- name: run
visibility: public
parameters:
- name: input
default: 'null'
- name: output
default: 'null'
comment: '# * Runs the current application.
# *
# * @return int 0 if everything went fine, or an error code
# *
# * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}.'
- name: doRun
visibility: public
parameters:
- name: input
- name: output
comment: '# * Runs the current application.
# *
# * @return int 0 if everything went fine, or an error code'
- name: reset
visibility: public
parameters: []
comment: null
- name: setHelperSet
visibility: public
parameters:
- name: helperSet
comment: null
- name: getHelperSet
visibility: public
parameters: []
comment: '# * Get the helper set associated with the command.'
- name: setDefinition
visibility: public
parameters:
- name: definition
comment: null
- name: getDefinition
visibility: public
parameters: []
comment: '# * Gets the InputDefinition related to this Application.'
- name: complete
visibility: public
parameters:
- name: input
- name: suggestions
comment: '# * Adds suggestions to $suggestions for the current completion input
(e.g. option or argument).'
- name: getHelp
visibility: public
parameters: []
comment: '# * Gets the help message.'
- name: areExceptionsCaught
visibility: public
parameters: []
comment: '# * Gets whether to catch exceptions or not during commands execution.'
- name: setCatchExceptions
visibility: public
parameters:
- name: boolean
comment: '# * Sets whether to catch exceptions or not during commands execution.'
- name: setCatchErrors
visibility: public
parameters:
- name: catchErrors
default: 'true'
comment: '# * Sets whether to catch errors or not during commands execution.'
- name: isAutoExitEnabled
visibility: public
parameters: []
comment: '# * Gets whether to automatically exit after a command execution or not.'
- name: setAutoExit
visibility: public
parameters:
- name: boolean
comment: '# * Sets whether to automatically exit after a command execution or not.'
- name: getName
visibility: public
parameters: []
comment: '# * Gets the name of the application.'
- name: setName
visibility: public
parameters:
- name: name
comment: '# * Sets the application name.'
- name: getVersion
visibility: public
parameters: []
comment: '# * Gets the application version.'
- name: setVersion
visibility: public
parameters:
- name: version
comment: '# * Sets the application version.'
- name: getLongVersion
visibility: public
parameters: []
comment: '# * Returns the long version of the application.'
- name: register
visibility: public
parameters:
- name: name
comment: '# * Registers a new command.'
- name: addCommands
visibility: public
parameters:
- name: commands
comment: '# * Adds an array of command objects.
# *
# * If a Command is not enabled it will not be added.
# *
# * @param Command[] $commands An array of commands'
- name: add
visibility: public
parameters:
- name: command
comment: '# * 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.'
- name: get
visibility: public
parameters:
- name: name
comment: '# * Returns a registered command by name or alias.
# *
# * @throws CommandNotFoundException When given command name does not exist'
- name: has
visibility: public
parameters:
- name: name
comment: '# * Returns true if the command exists, false otherwise.'
- name: getNamespaces
visibility: public
parameters: []
comment: '# * Returns an array of all unique namespaces used by currently registered
commands.
# *
# * It does not return the global namespace which always exists.
# *
# * @return string[]'
- name: findNamespace
visibility: public
parameters:
- name: namespace
comment: '# * Finds a registered namespace by a name or an abbreviation.
# *
# * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous'
- name: find
visibility: public
parameters:
- name: name
comment: '# * 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'
- name: all
visibility: public
parameters:
- name: namespace
default: 'null'
comment: '# * 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[]'
- name: getAbbreviations
visibility: public
parameters:
- name: names
comment: '# * Returns an array of possible abbreviations given a set of names.
# *
# * @return string[][]'
- name: renderThrowable
visibility: public
parameters:
- name: e
- name: output
comment: null
- name: doRenderThrowable
visibility: protected
parameters:
- name: e
- name: output
comment: null
- name: configureIO
visibility: protected
parameters:
- name: input
- name: output
comment: '# * Configures the input and output instances based on the user arguments
and options.'
- name: doRunCommand
visibility: protected
parameters:
- name: command
- name: input
- name: output
comment: '# * 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'
- name: getCommandName
visibility: protected
parameters:
- name: input
comment: '# * Gets the name of the command based on input.'
- name: getDefaultInputDefinition
visibility: protected
parameters: []
comment: '# * Gets the default input definition.'
- name: getDefaultCommands
visibility: protected
parameters: []
comment: '# * Gets the default commands that should always be available.
# *
# * @return Command[]'
- name: getDefaultHelperSet
visibility: protected
parameters: []
comment: '# * Gets the default helper set with the helpers that should always be
available.'
- name: getAbbreviationSuggestions
visibility: private
parameters:
- name: abbrevs
comment: '# * Returns abbreviated suggestions in string format.'
- name: extractNamespace
visibility: public
parameters:
- name: name
- name: limit
default: 'null'
comment: '# * Returns the namespace part of the command name.
# *
# * This method is not part of public API and should not be used directly.'
- name: findAlternatives
visibility: private
parameters:
- name: name
- name: collection
comment: '# * Finds alternative of $name among $collection,
# * if nothing is found in $collection, try in $abbrevs.
# *
# * @return string[]'
- name: setDefaultCommand
visibility: public
parameters:
- name: commandName
- name: isSingleCommand
default: 'false'
comment: '# * Sets the default Command name.
# *
# * @return $this'
- name: isSingleCommand
visibility: public
parameters: []
comment: '# * @internal'
- name: splitStringByWidth
visibility: private
parameters:
- name: string
- name: width
comment: null
- name: extractAllNamespaces
visibility: private
parameters:
- name: name
comment: '# * Returns all namespaces of the command name.
# *
# * @return string[]'
- name: init
visibility: private
parameters: []
comment: null
traits:
- Symfony\Component\Console\Command\Command
- Symfony\Component\Console\Command\CompleteCommand
- Symfony\Component\Console\Command\DumpCompletionCommand
- Symfony\Component\Console\Command\HelpCommand
- Symfony\Component\Console\Command\LazyCommand
- Symfony\Component\Console\Command\ListCommand
- Symfony\Component\Console\Command\SignalableCommandInterface
- Symfony\Component\Console\CommandLoader\CommandLoaderInterface
- Symfony\Component\Console\Completion\CompletionInput
- Symfony\Component\Console\Completion\CompletionSuggestions
- Symfony\Component\Console\Completion\Suggestion
- Symfony\Component\Console\Event\ConsoleCommandEvent
- Symfony\Component\Console\Event\ConsoleErrorEvent
- Symfony\Component\Console\Event\ConsoleSignalEvent
- Symfony\Component\Console\Event\ConsoleTerminateEvent
- Symfony\Component\Console\Exception\CommandNotFoundException
- Symfony\Component\Console\Exception\ExceptionInterface
- Symfony\Component\Console\Exception\LogicException
- Symfony\Component\Console\Exception\NamespaceNotFoundException
- Symfony\Component\Console\Exception\RuntimeException
- Symfony\Component\Console\Formatter\OutputFormatter
- Symfony\Component\Console\Helper\DebugFormatterHelper
- Symfony\Component\Console\Helper\DescriptorHelper
- Symfony\Component\Console\Helper\FormatterHelper
- Symfony\Component\Console\Helper\Helper
- Symfony\Component\Console\Helper\HelperSet
- Symfony\Component\Console\Helper\ProcessHelper
- Symfony\Component\Console\Helper\QuestionHelper
- Symfony\Component\Console\Input\ArgvInput
- Symfony\Component\Console\Input\ArrayInput
- Symfony\Component\Console\Input\InputArgument
- Symfony\Component\Console\Input\InputAwareInterface
- Symfony\Component\Console\Input\InputDefinition
- Symfony\Component\Console\Input\InputInterface
- Symfony\Component\Console\Input\InputOption
- Symfony\Component\Console\Output\ConsoleOutput
- Symfony\Component\Console\Output\ConsoleOutputInterface
- Symfony\Component\Console\Output\OutputInterface
- Symfony\Component\Console\SignalRegistry\SignalRegistry
- Symfony\Component\Console\Style\SymfonyStyle
- Symfony\Component\ErrorHandler\ErrorHandler
- Symfony\Contracts\EventDispatcher\EventDispatcherInterface
- Symfony\Contracts\Service\ResetInterface
interfaces:
- ResetInterface