FactoryCreatorCommand
in package
Table of Contents
- COMMAND_DUMP = 'dump'
- COMMAND_ERROR = 'error'
- COMMAND_HELP = 'help'
- DEFAULT_SCRIPT_NAME = __CLASS__
- HELP_TEMPLATE = <<<EOH <info>Usage:</info> %s [-h|--help|help] <className> <info>Arguments:</info> <info>-h|--help|help</info> This usage message <info><className></info> Name of the class to reflect and for which to generate a factory. Generates to STDOUT a factory for creating the specified class; this may then be added to your application, and configured as a factory for the class. EOH
- $helper : ConsoleHelper
- $scriptName : string
- __construct() : mixed
- __invoke() : int
- createArguments() : stdClass
- help() : void
- parseArgs() : stdClass
Constants
COMMAND_DUMP
public
mixed
COMMAND_DUMP
= 'dump'
COMMAND_ERROR
public
mixed
COMMAND_ERROR
= 'error'
COMMAND_HELP
public
mixed
COMMAND_HELP
= 'help'
DEFAULT_SCRIPT_NAME
public
mixed
DEFAULT_SCRIPT_NAME
= __CLASS__
HELP_TEMPLATE
public
mixed
HELP_TEMPLATE
= <<<EOH
<info>Usage:</info>
%s [-h|--help|help] <className>
<info>Arguments:</info>
<info>-h|--help|help</info> This usage message
<info><className></info> Name of the class to reflect and for which to generate
a factory.
Generates to STDOUT a factory for creating the specified class; this may then
be added to your application, and configured as a factory for the class.
EOH
Properties
$helper
private
ConsoleHelper
$helper
$scriptName
private
string
$scriptName
Methods
__construct()
public
__construct([string $scriptName = self::DEFAULT_SCRIPT_NAME ][, ConsoleHelper $helper = null ]) : mixed
Parameters
- $scriptName : string = self::DEFAULT_SCRIPT_NAME
- $helper : ConsoleHelper = null
Return values
mixed —__invoke()
public
__invoke(array<string|int, mixed> $args) : int
Parameters
- $args : array<string|int, mixed>
-
Argument list, minus script name
Return values
int —Exit status
createArguments()
private
createArguments(string $command[, string|null $class = null ][, string|null $error = null ]) : stdClass
Parameters
- $command : string
- $class : string|null = null
-
Name of class to reflect.
- $error : string|null = null
-
Error message, if any.
Return values
stdClass —help()
private
help([resource $resource = STDOUT ]) : void
Parameters
- $resource : resource = STDOUT
-
Defaults to STDOUT
Return values
void —parseArgs()
private
parseArgs(array<string|int, mixed> $args) : stdClass
Parameters
- $args : array<string|int, mixed>