HumHub Documentation (unofficial)

FactoryCreatorCommand
in package

Tags
psalm-type

ArgumentObject = object{command:string, class:null|string, message:null|string}

Table of Contents

Constants

COMMAND_DUMP  = 'dump'
COMMAND_ERROR  = 'error'
COMMAND_HELP  = 'help'
DEFAULT_SCRIPT_NAME  = self::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

Properties

$helper  : ConsoleHelper
$scriptName  : mixed

Methods

__construct()  : mixed
__invoke()  : int
createArguments()  : ArgumentObject
help()  : void
parseArgs()  : ArgumentObject

Constants

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

Methods

__construct()

public __construct([string $scriptName = self::DEFAULT_SCRIPT_NAME ][, ConsoleHelper|null $helper = null ]) : mixed
Parameters
$scriptName : string = self::DEFAULT_SCRIPT_NAME
$helper : ConsoleHelper|null = null

__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 ]) : ArgumentObject
Parameters
$command : string
$class : string|null = null

Name of class to reflect.

$error : string|null = null

Error message, if any.

Return values
ArgumentObject

help()

private help([resource $resource = STDOUT ]) : void
Parameters
$resource : resource = STDOUT

Defaults to STDOUT

parseArgs()

private parseArgs(array<string|int, mixed> $args) : ArgumentObject
Parameters
$args : array<string|int, mixed>
Return values
ArgumentObject

        
On this page

Search results