class Parser (View source)

Methods

static array{string, array{}, array{}}|InputOption[]}
parse(string $expression)

Parse the given console command definition into an array.

static string
name(string $expression)

Extract the name of the command from the expression.

static InputOption[]}
parameters(array $tokens)

Extract all parameters from the tokens.

static InputArgument
parseArgument(string $token)

Parse an argument expression.

static InputOption
parseOption(string $token)

Parse an option expression.

static array{string, string}
extractDescription(string $token)

Parse the token into its token and description segments.

Details

static array{string, array{}, array{}}|InputOption[]} parse(string $expression)

Parse the given console command definition into an array.

Parameters

string $expression

Return Value

array{string, array{}, array{}}|InputOption[]}

Exceptions

InvalidArgumentException

static protected string name(string $expression)

Extract the name of the command from the expression.

Parameters

string $expression

Return Value

string

Exceptions

InvalidArgumentException

static protected InputOption[]} parameters(array $tokens)

Extract all parameters from the tokens.

Parameters

array $tokens

Return Value

InputOption[]}

static protected InputArgument parseArgument(string $token)

Parse an argument expression.

Parameters

string $token

Return Value

InputArgument

static protected InputOption parseOption(string $token)

Parse an option expression.

Parameters

string $token

Return Value

InputOption

static protected array{string, string} extractDescription(string $token)

Parse the token into its token and description segments.

Parameters

string $token

Return Value

array{string, string}

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.