RequestBuilder
class RequestBuilder (View source)
Builds a CLI request object from the raw command call
Constants
ARGUMENT_MATCHING_EXPRESSION |
This is used to parse the command line, when it's passed as a string |
Properties
protected Environment | $environment | ||
protected ObjectManagerInterface | $objectManager | ||
protected PackageManager | $packageManager | ||
protected CommandManager | $commandManager |
Methods
Takes an array of unparsed command line arguments and options and converts it separated by named arguments, options and unnamed arguments.
Extracts the option or argument name from the name / value pair of a command line.
Returns the value of the first argument of the given input array. Shifts the parsed argument off the array.
Details
void
injectEnvironment(Environment $environment)
No description
void
injectObjectManager(ObjectManagerInterface $objectManager)
No description
void
injectPackageManager(PackageManager $packageManager)
No description
void
injectCommandManager(CommandManager $commandManager)
No description
Request
build(mixed $commandLine)
Builds a CLI request object from a command line.
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.
protected array
parseRawCommandLineArguments(array $rawCommandLineArguments, string $controllerObjectName, string $controllerCommandName)
Takes an array of unparsed command line arguments and options and converts it separated by named arguments, options and unnamed arguments.
protected string
extractArgumentNameFromCommandLinePart(string $commandLinePart)
Extracts the option or argument name from the name / value pair of a command line.
protected mixed
getValueOfCurrentCommandLineOption(string $currentArgument, array $rawCommandLineArguments, string $expectedArgumentType)
Returns the value of the first argument of the given input array. Shifts the parsed argument off the array.