abstract class ConsoleCommand extends Command

Extends Command class and provides $input and $output as instance variables of their respective classes. Also contains helper for returning an instance of the FrameworkQuestion class.

Traits

Wrapper class for InputInterface functions.

Properties

protected InputInterface $input

The Symfony InputInterface object.

protected OutputInterface $output

The Symfony OutputInterface object.

Methods

mixed
getArgument(mixed $argument)

Wrapper for InputInterface::getArgument function.

mixed
getOption(mixed $option)

Wrapper for InputInterface::getOption function.

bool
hasOption(string $name)

Wrapper for InputInterface::hasOption function.

int
execute(InputInterface $input, OutputInterface $output)

Implements execute from parent class.

int
handle()

Executes logic for command.

question()

Returns instance of the FrameworkQuestion class.

Details

in ConsoleIO at line 16
mixed getArgument(mixed $argument)

Wrapper for InputInterface::getArgument function.

Parameters

mixed $argument

The argument.

Return Value

mixed

The value for the argument.

in ConsoleIO at line 26
mixed getOption(mixed $option)

Wrapper for InputInterface::getOption function.

Parameters

mixed $option

The option.

Return Value

mixed

The value for the option.

in ConsoleIO at line 36
bool hasOption(string $name)

Wrapper for InputInterface::hasOption function.

Parameters

string $name

The name for the option.

Return Value

bool

True if exists, otherwise false.

at line 39
protected int execute(InputInterface $input, OutputInterface $output)

Implements execute from parent class.

Parameters

InputInterface $input

The Symfony InputInterface object.

OutputInterface $output

The Symfony OutputInterface object.

Return Value

int

A value that indicates success, invalid, or failure.

at line 50
abstract protected int handle()

Executes logic for command.

Return Value

int

A value that indicates success, invalid, or failure.

at line 57
protected FrameworkQuestion question()

Returns instance of the FrameworkQuestion class.

Return Value

FrameworkQuestion

The instance of the FrameworkQuestion class.