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 27
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 190
protected
drawArgumentTable(string $heading, array $arguments)
Draws an argument table.
at line 210
protected
displayReactorInfo()
Displays basic reactor information.
at line 242
protected CommandInterface
instantiateCommandWithoutConstructor(string $class)
Instantiates command without calling the constructor.
at line 252
protected array
getCommands()
Returns an array of command information.
at line 271
protected
listCommands()
Lists available commands if there are any.
at line 283
protected int
displayReactorInfoAndCommandList()
Displays reactor info and lists all available commands.
at line 298
protected bool
commandExists(string $command)
Returns TRUE if the command exists and FALSE if not.
at line 309
protected int
unknownCommand(string $command)
Displays error message for unknown commands.
at line 331
protected int
displayCommandHelp(string $command)
Displays information about the chosen command.
at line 360
protected int
registerCommandArgumentsAndDispatch(string $command)
Registers the command arguments and dispatches the command.
at line 374
int
run()
Run the reactor.