final class CommandFormatter (View source)

CommandFormatter

Constants

private CONTACT_FIELDS_PRIORITY

Static priority seed: the base property patterns plus the contact type and field patterns from which getPropertiesPriority() builds the full map. The data never changes at runtime, so it lives as a class constant rather than a rebuilt-per-call literal.

Methods

static array
getSortedCommand(array $command)

Get the sorted command array based on priority

static array
flattenCommand(array $cmd, bool $upperCaseKeys = 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 $upperCaseKeys = true)

Flatten API command's nested arrays for easier handling

Parameters

array $cmd

API Command

bool $upperCaseKeys

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