final class CommandFormatter (View source)

CommandFormatter

Methods

static array
getSortedCommand(array $command)

Get the sorted command array based on priority

static array
flattenCommand(array $cmd, bool $toupper = true)

Flatten API command's nested arrays for easier handling

static string
formatCommand(array $command)

Format the command array into a plain text string

Details

static array getSortedCommand(array $command)

Get the sorted command array based on priority

Parameters

array $command

The command array to be sorted

Return Value

array

The sorted command array

static array flattenCommand(array $cmd, bool $toupper = true)

Flatten API command's nested arrays for easier handling

Parameters

array $cmd

API Command

bool $toupper

flag to convert keys to uppercase or leave as is

Return Value

array

static string formatCommand(array $command)

Format the command array into a plain text string

Parameters

array $command

The command array to be formatted

Return Value

string

The formatted command string