DevCommands
class DevCommands
Properties
| static protected NodePackageManager|null | $packageManager | The resolved NodePackageManager instance. |
|
| static protected int | $colorCount | Counter to keep track of how many colors have been assigned. |
|
| static protected DevCommand> | $commands | The registered development commands. |
|
| static protected list<string> | $only | The names of commands that should be included when running the "dev" command. |
|
| static protected list<string> | $except | The names of commands that should be excluded when running the "dev" command. |
Methods
Register the default development commands.
Register a development command.
Register an Artisan command, automatically prefixing it with "php artisan".
Register a Node command, automatically prefixing it with the detected package manager's run command.
Register a Node command, automatically prefixing it with the detected package manager's exec command.
Get the registered development commands.
Fill in any empty colors in the given commands array, ensuring each command has a color assigned.
Get a color for a command, ensuring that colors are reused only after all available colors have been used at least once.
Resolve the first external caller frame from a debug backtrace.
Determine the registration priority from a debug backtrace.
Determine whether a file belongs to an installed Composer dependency.
Determine whether a path is the given directory or one of its descendants.
Set the commands that should be included when running the "dev" command.
Set the commands that should be excluded when running the "dev" command.
Resolve and return the NodePackageManager instance.
Flush all static state.
Details
at line 52
static void
registerDefaults()
Register the default development commands.
Boot-only. The commands persist in static properties for the worker lifetime and affect every subsequent development command invocation.
at line 71
static DevCommand
register(string $command, string|null $name = null)
Register a development command.
Boot-only. The command persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 98
static DevCommand
artisan(string $command, string|null $name = null)
Register an Artisan command, automatically prefixing it with "php artisan".
Boot-only. The command persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 109
static DevCommand
node(string $command, string|null $name = null)
Register a Node command, automatically prefixing it with the detected package manager's run command.
Boot-only. The command persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 120
static DevCommand
nodeExec(string $command, string|null $name = null)
Register a Node command, automatically prefixing it with the detected package manager's exec command.
Boot-only. The command persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 130
static array
commands()
Get the registered development commands.
at line 153
static protected array
fillInEmptyColors(array $commands)
Fill in any empty colors in the given commands array, ensuring each command has a color assigned.
at line 169
static protected string
getColor(array $commands)
Get a color for a command, ensuring that colors are reused only after all available colors have been used at least once.
at line 185
static protected array
resolveSource(array $trace)
Resolve the first external caller frame from a debug backtrace.
at line 208
static protected int
resolvePriority(array $trace)
Determine the registration priority from a debug backtrace.
at line 249
static protected bool
isDependencyFile(string $file)
Determine whether a file belongs to an installed Composer dependency.
at line 275
static protected bool
isWithinPath(string $path, string $directory)
Determine whether a path is the given directory or one of its descendants.
at line 286
static void
only(string ...$names)
Set the commands that should be included when running the "dev" command.
Boot-only. The filter persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 297
static void
except(string ...$names)
Set the commands that should be excluded when running the "dev" command.
Boot-only. The filter persists in a static property for the worker lifetime and affects every subsequent development command invocation.
at line 305
static protected NodePackageManager
getPackageManager()
Resolve and return the NodePackageManager instance.
at line 313
static void
flushState()
Flush all static state.