class DevCommand

Constants

PRIORITY_DEFAULT

The priority level for default commands that are registered by the framework.

PRIORITY_VENDOR

The priority level for commands that are registered by packages in the vendor directory.

PRIORITY_USERLAND

The priority level for commands that are registered by the user in their application.

Properties

protected string|null $color

Color of the command when output to the console.

Methods

__construct(string $command, array $source, string|null $name = null, int $priority = self::PRIORITY_USERLAND)

Create a new DevCommand instance.

static string
nameFromCommand(string $command)

Derive the name from a command string.

string
name()

Get the command name.

int
priority()

Get the command priority.

color(string $color)

Set the command color.

blue()

Set the command color to blue.

purple()

Set the command color to purple.

pink()

Set the command color to pink.

orange()

Set the command color to orange.

green()

Set the command color to green.

yellow()

Set the command color to yellow.

array
toArray()

Get the command as an array.

Details

at line 35
__construct(string $command, array $source, string|null $name = null, int $priority = self::PRIORITY_USERLAND)

Create a new DevCommand instance.

Parameters

string $command
array $source
string|null $name
int $priority

at line 47
static string nameFromCommand(string $command)

Derive the name from a command string.

Parameters

string $command

Return Value

string

at line 55
string name()

Get the command name.

Return Value

string

at line 63
int priority()

Get the command priority.

Return Value

int

at line 71
DevCommand color(string $color)

Set the command color.

Parameters

string $color

Return Value

DevCommand

at line 81
DevCommand blue()

Set the command color to blue.

Return Value

DevCommand

at line 89
DevCommand purple()

Set the command color to purple.

Return Value

DevCommand

at line 97
DevCommand pink()

Set the command color to pink.

Return Value

DevCommand

at line 105
DevCommand orange()

Set the command color to orange.

Return Value

DevCommand

at line 113
DevCommand green()

Set the command color to green.

Return Value

DevCommand

at line 121
DevCommand yellow()

Set the command color to yellow.

Return Value

DevCommand

at line 131
array toArray()

Get the command as an array.

Return Value

array