PHP Class Neos\Flow\Cli\RequestBuilder

Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$commandManager CommandManager
$environment Neos\Flow\Utility\Environment
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$packageManager Neos\Flow\Package\PackageManagerInterface

Méthodes publiques

Méthode Description
build ( mixed $commandLine ) : Request Builds a CLI request object from a command line.
injectCommandManager ( CommandManager $commandManager ) : void
injectEnvironment ( Environment $environment ) : void
injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void
injectPackageManager ( Neos\Flow\Package\PackageManagerInterface $packageManager ) : void

Méthodes protégées

Méthode Description
extractArgumentNameFromCommandLinePart ( string $commandLinePart ) : string Extracts the option or argument name from the name / value pair of a command line.
getValueOfCurrentCommandLineOption ( string $currentArgument, array &$rawCommandLineArguments, string $expectedArgumentType ) : string Returns the value of the first argument of the given input array. Shifts the parsed argument off the array.
parseRawCommandLineArguments ( array $rawCommandLineArguments, string $controllerObjectName, string $controllerCommandName ) : array Takes an array of unparsed command line arguments and options and converts it separated by named arguments, options and unnamed arguments.

Method Details

build() public méthode

The given command line may be a string (e.g. "mypackage:foo do-that-thing --force") or an array consisting of the individual parts. The array must not include the script name (like in $argv) but start with command right away.
public build ( mixed $commandLine ) : Request
$commandLine mixed The command line, either as a string or as an array
Résultat Request The CLI request as an object

extractArgumentNameFromCommandLinePart() protected méthode

Extracts the option or argument name from the name / value pair of a command line.
protected extractArgumentNameFromCommandLinePart ( string $commandLinePart ) : string
$commandLinePart string Part of the command line, e.g. "my-important-option=SomeInterestingValue"
Résultat string The lowercased argument name, e.g. "myimportantoption"

getValueOfCurrentCommandLineOption() protected méthode

Returns the value of the first argument of the given input array. Shifts the parsed argument off the array.
protected getValueOfCurrentCommandLineOption ( string $currentArgument, array &$rawCommandLineArguments, string $expectedArgumentType ) : string
$currentArgument string The current argument
$rawCommandLineArguments array
$expectedArgumentType string The expected type of the current argument, because booleans get special attention
Résultat string The value of the first argument

injectCommandManager() public méthode

public injectCommandManager ( CommandManager $commandManager ) : void
$commandManager CommandManager
Résultat void

injectEnvironment() public méthode

public injectEnvironment ( Environment $environment ) : void
$environment Neos\Flow\Utility\Environment
Résultat void

injectObjectManager() public méthode

public injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
Résultat void

injectPackageManager() public méthode

public injectPackageManager ( Neos\Flow\Package\PackageManagerInterface $packageManager ) : void
$packageManager Neos\Flow\Package\PackageManagerInterface
Résultat void

parseRawCommandLineArguments() protected méthode

Takes an array of unparsed command line arguments and options and converts it separated by named arguments, options and unnamed arguments.
protected parseRawCommandLineArguments ( array $rawCommandLineArguments, string $controllerObjectName, string $controllerCommandName ) : array
$rawCommandLineArguments array The unparsed command parts (such as "--foo") as an array
$controllerObjectName string Object name of the designated command controller
$controllerCommandName string Command name of the recognized command (ie. method name without "Command" suffix)
Résultat array All and exceeding command line arguments

Property Details

$commandManager protected_oe property

protected CommandManager,Neos\Flow\Cli $commandManager
Résultat CommandManager

$environment protected_oe property

protected Environment,Neos\Flow\Utility $environment
Résultat Neos\Flow\Utility\Environment

$objectManager protected_oe property

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
Résultat Neos\Flow\ObjectManagement\ObjectManagerInterface

$packageManager protected_oe property

protected PackageManagerInterface,Neos\Flow\Package $packageManager
Résultat Neos\Flow\Package\PackageManagerInterface