HumHub Documentation (unofficial)

ConfigDumperCommand
in package

Tags
psalm-type

HelpObject = object{ command: string }

psalm-type

ErrorObject = object{ command: string, message: string }

psalm-type

ArgumentObject = object{ command: string, configFile: string, config: array<array-key, mixed>, class: string, ignoreUnresolved: bool }

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] [-i|--ignore-unresolved] <configFile> <className> <info>Arguments:</info> <info>-h|--help|help</info> This usage message <info>-i|--ignore-unresolved</info> Ignore classes with unresolved direct dependencies. <info><configFile></info> Path to a config file for which to generate configuration. If the file does not exist, it will be created. If it does exist, it must return an array, and the file will be updated with new configuration. <info><className></info> Name of the class to reflect and for which to generate dependency configuration. Reads the provided configuration file (creating it if it does not exist), and injects it with ConfigAbstractFactory dependency configuration for the provided class name, writing the changes back to the file. EOH

Properties

$helper  : ConsoleHelper
$scriptName  : mixed

Methods

__construct()  : mixed
__invoke()  : int
createArguments()  : ArgumentObject
createErrorArgument()  : ErrorObject
createHelpArgument()  : HelpObject
help()  : void
parseArgs()  : object

Constants

HELP_TEMPLATE

public mixed HELP_TEMPLATE = <<<EOH <info>Usage:</info> %s [-h|--help|help] [-i|--ignore-unresolved] <configFile> <className> <info>Arguments:</info> <info>-h|--help|help</info> This usage message <info>-i|--ignore-unresolved</info> Ignore classes with unresolved direct dependencies. <info><configFile></info> Path to a config file for which to generate configuration. If the file does not exist, it will be created. If it does exist, it must return an array, and the file will be updated with new configuration. <info><className></info> Name of the class to reflect and for which to generate dependency configuration. Reads the provided configuration file (creating it if it does not exist), and injects it with ConfigAbstractFactory dependency configuration for the provided class name, writing the changes back to the file. 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 $configFile, array<string|int, mixed> $config, string $class, bool $ignoreUnresolved) : ArgumentObject
Parameters
$command : string
$configFile : string

File from which config originates, and to which it will be written.

$config : array<string|int, mixed>

Parsed configuration.

$class : string

Name of class to reflect.

$ignoreUnresolved : bool

If to ignore classes with unresolved direct dependencies.

Return values
ArgumentObject

createErrorArgument()

private createErrorArgument(string $message) : ErrorObject
Parameters
$message : string
Return values
ErrorObject

createHelpArgument()

private createHelpArgument() : HelpObject
Return values
HelpObject

help()

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

Defaults to STDOUT

parseArgs()

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

        
On this page

Search results