Reactor
class Reactor
Reactor.
Traits
Properties
protected Input | $input | Input. | |
protected Output | $output | Output. | |
protected Container | $container | Container. | |
protected Dispatcher | $dispatcher | Dispatcher. | |
protected array | $commands | Commands. | |
protected string | $logo | Logo. |
Methods
Returns the string that resembles the provided string the most.
Constructor.
Registers a command.
Sets the reactor logo.
Setup the reactor.
Draws information table.
Draws an argument table.
Displays basic reactor information.
Instantiates command without calling the constructor.
Returns an array of command information.
Lists available commands if there are any.
Displays reactor info and lists all available commands.
Returns TRUE if the command exists and FALSE if not.
Displays error message for unknown commands.
Displays information about the chosen command.
Registers the command arguments and dispatches the command.
Run the reactor.
Details
in SuggestionTrait at line 25
protected string|null
suggest(string $string, array $alternatives)
Returns the string that resembles the provided string the most.
NULL is returned if no string with a similarity of 66% or more is found.
at line 85
__construct(Input $input, Output $output, Container|null $container = null, Dispatcher|null $dispatcher = null)
Constructor.
at line 101
Input
getInput()
Returns the input.
at line 111
Output
getOutput()
Returns the output.
at line 122
registerCommand(string $command, string $class)
Registers a command.
at line 132
setLogo(string $logo)
Sets the reactor logo.
at line 140
protected
setup()
Setup the reactor.
at line 166
protected
drawTable(string $heading, array $headers, array $rows)
Draws information table.
at line 193
protected
drawArgumentTable(string $heading, array $arguments)
Draws an argument table.
at line 213
protected
displayReactorInfo()
Displays basic reactor information.
at line 245
protected CommandInterface
instantiateCommandWithoutConstructor(string $class)
Instantiates command without calling the constructor.
at line 255
protected array
getCommands()
Returns an array of command information.
at line 274
protected
listCommands()
Lists available commands if there are any.
at line 286
protected int
displayReactorInfoAndCommandList()
Displays reactor info and lists all available commands.
at line 301
protected bool
commandExists(string $command)
Returns TRUE if the command exists and FALSE if not.
at line 312
protected int
unknownCommand(string $command)
Displays error message for unknown commands.
at line 334
protected int
displayCommandHelp(string $command)
Displays information about the chosen command.
at line 363
protected int
registerCommandArgumentsAndDispatch(string $command)
Registers the command arguments and dispatches the command.
at line 381
int
run()
Run the reactor.