[ Index ]

PHP Cross Reference of phpBB-3.3.5-deutsch

title

Body

[close]

/vendor/symfony/console/Command/ -> Command.php (summary)

(no description)

File Size: 666 lines (20 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Command:: (37 methods):
  getDefaultName()
  __construct()
  ignoreValidationErrors()
  setApplication()
  setHelperSet()
  getHelperSet()
  getApplication()
  isEnabled()
  configure()
  execute()
  interact()
  initialize()
  run()
  setCode()
  mergeApplicationDefinition()
  setDefinition()
  getDefinition()
  getNativeDefinition()
  addArgument()
  addOption()
  setName()
  setProcessTitle()
  getName()
  setHidden()
  isHidden()
  setDescription()
  getDescription()
  setHelp()
  getHelp()
  getProcessedHelp()
  setAliases()
  getAliases()
  getSynopsis()
  addUsage()
  getUsages()
  getHelper()
  validateName()


Class: Command  - X-Ref

Base class for all commands.

getDefaultName()   X-Ref

return: string|null The default command name or null when no default name is set

__construct($name = null)   X-Ref

param: string|null $name The name of the command; passing null means it must be set in configure()

ignoreValidationErrors()   X-Ref
Ignores validation errors.

This is mainly useful for the help command.

setApplication(Application $application = null)   X-Ref
No description

setHelperSet(HelperSet $helperSet)   X-Ref
No description

getHelperSet()   X-Ref
Gets the helper set.

return: HelperSet|null A HelperSet instance

getApplication()   X-Ref
Gets the application instance for this command.

return: Application|null An Application instance

isEnabled()   X-Ref
Checks whether the command is enabled or not in the current environment.

Override this to check for x or y and return false if the command can not
run properly under the current conditions.

return: bool

configure()   X-Ref
Configures the current command.


execute(InputInterface $input, OutputInterface $output)   X-Ref
Executes the current command.

This method is not abstract because you can use this class
as a concrete class. In this case, instead of defining the
execute() method, you set the code to execute by passing
a Closure to the setCode() method.

return: int|null null or 0 if everything went fine, or an error code

interact(InputInterface $input, OutputInterface $output)   X-Ref
Interacts with the user.

This method is executed before the InputDefinition is validated.
This means that this is the only place where the command can
interactively ask for values of missing required arguments.

initialize(InputInterface $input, OutputInterface $output)   X-Ref
Initializes the command after the input has been bound and before the input
is validated.

This is mainly useful when a lot of commands extends one main command
where some things need to be initialized based on the input arguments and options.


run(InputInterface $input, OutputInterface $output)   X-Ref
Runs the command.

The code to execute is either defined directly with the
setCode() method or by overriding the execute() method
in a sub-class.

return: int The command exit code

setCode(callable $code)   X-Ref
Sets the code to execute when running this command.

If this method is used, it overrides the code defined
in the execute() method.

param: callable $code A callable(InputInterface $input, OutputInterface $output)
return: $this

mergeApplicationDefinition($mergeArgs = true)   X-Ref
Merges the application definition with the command definition.

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

param: bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments

setDefinition($definition)   X-Ref
Sets an array of argument and option instances.

param: array|InputDefinition $definition An array of argument and option instances or a definition instance
return: $this

getDefinition()   X-Ref
Gets the InputDefinition attached to this Command.

return: InputDefinition An InputDefinition instance

getNativeDefinition()   X-Ref
Gets the InputDefinition to be used to create representations of this Command.

Can be overridden to provide the original command representation when it would otherwise
be changed by merging with the application InputDefinition.

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

return: InputDefinition An InputDefinition instance

addArgument($name, $mode = null, $description = '', $default = null)   X-Ref
Adds an argument.

param: string               $name        The argument name
param: int|null             $mode        The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
param: string               $description A description text
param: string|string[]|null $default     The default value (for InputArgument::OPTIONAL mode only)
return: $this

addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)   X-Ref
Adds an option.

param: string                        $name        The option name
param: string|array|null             $shortcut    The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
param: int|null                      $mode        The option mode: One of the InputOption::VALUE_* constants
param: string                        $description A description text
param: string|string[]|int|bool|null $default     The default value (must be null for InputOption::VALUE_NONE)
return: $this

setName($name)   X-Ref
Sets the name of the command.

This method can set both the namespace and the name if
you separate them by a colon (:)

$command->setName('foo:bar');

param: string $name The command name
return: $this

setProcessTitle($title)   X-Ref
Sets the process title of the command.

This feature should be used only when creating a long process command,
like a daemon.

param: string $title The process title
return: $this

getName()   X-Ref
Returns the command name.

return: string|null

setHidden($hidden)   X-Ref

param: bool $hidden Whether or not the command should be hidden from the list of commands
return: Command The current instance

isHidden()   X-Ref

return: bool whether the command should be publicly shown or not

setDescription($description)   X-Ref
Sets the description for the command.

param: string $description The description for the command
return: $this

getDescription()   X-Ref
Returns the description for the command.

return: string The description for the command

setHelp($help)   X-Ref
Sets the help for the command.

param: string $help The help for the command
return: $this

getHelp()   X-Ref
Returns the help for the command.

return: string The help for the command

getProcessedHelp()   X-Ref
Returns the processed help for the command replacing the %command.name% and
%command.full_name% patterns with the real values dynamically.

return: string The processed help for the command

setAliases($aliases)   X-Ref
Sets the aliases for the command.

param: string[] $aliases An array of aliases for the command
return: $this

getAliases()   X-Ref
Returns the aliases for the command.

return: array An array of aliases for the command

getSynopsis($short = false)   X-Ref
Returns the synopsis for the command.

param: bool $short Whether to show the short version of the synopsis (with options folded) or not
return: string The synopsis

addUsage($usage)   X-Ref
Add a command usage example.

param: string $usage The usage, it'll be prefixed with the command name
return: $this

getUsages()   X-Ref
Returns alternative usages of the command.

return: array

getHelper($name)   X-Ref
Gets a helper instance by name.

param: string $name The helper name
return: mixed The helper value

validateName($name)   X-Ref
Validates a command name.

It must be non-empty and parts can optionally be separated by ":".

param: string $name



Generated: Mon Oct 4 17:42:11 2021 Cross-referenced by PHPXref 0.7.1