Namespaces
extends BaseCommand
in package
Lists namespaces set in Config\Autoload with their full server path. Helps you to verify that you have the namespaces setup correctly.
Tags
Table of Contents
Properties
- $arguments : array<string, string>
- $commands : Commands
- $description : string
- $group : string
- $logger : LoggerInterface
- $name : string
- $options : array<string, string>
- $usage : string
- $arguments : array<string, string>
- the Command's Arguments
- $commands : Commands
- Instance of Commands so commands can call other commands.
- $description : string
- the Command's short description
- $group : string
- The group the command is lumped under when listing commands.
- $logger : LoggerInterface
- The Logger to use for a command
- $name : string
- The Command's name
- $options : array<string, string>
- the Command's Options
- $usage : string
- the Command's usage
Methods
- __construct() : mixed
- __get() : array<string, string>|Commands|LoggerInterface|string|null
- Makes it simple to access our protected properties.
- __isset() : bool
- Makes it simple to check our protected properties.
- getPad() : int
- Get pad for $key => $value array output
- run() : int|void
- Displays the help for the spark cli script itself.
- setPad() : string
- Pads our string out so that all titles are the same length to nicely line up descriptions.
- showHelp() : void
- Show Help includes (Usage, Arguments, Description, Options).
- call() : int|void
- Can be used by a command to run other commands.
- showError() : void
- A simple method to display an error with line/file, in child commands.
- outputAllNamespaces() : array<string|int, mixed>
- outputCINamespaces() : array<string|int, mixed>
- truncate() : string
Properties
$arguments
public
array<string, string>
$arguments
$commands
public
Commands
$commands
$description
public
string
$description
$group
public
string
$group
$logger
public
LoggerInterface
$logger
$name
public
string
$name
$options
public
array<string, string>
$options
$usage
public
string
$usage
$arguments
the Command's Arguments
protected
array<string, string>
$arguments
= []
$commands
Instance of Commands so commands can call other commands.
protected
Commands
$commands
$description
the Command's short description
protected
string
$description
= 'Verifies your namespaces are setup correctly.'
$group
The group the command is lumped under when listing commands.
protected
string
$group
= 'CodeIgniter'
$logger
The Logger to use for a command
protected
LoggerInterface
$logger
$name
The Command's name
protected
string
$name
= 'namespaces'
$options
the Command's Options
protected
array<string, string>
$options
= ['-c' => 'Show only CodeIgniter config namespaces.', '-r' => 'Show raw path strings.', '-m' => 'Specify max length of the path strings to output. Default: 60.']
$usage
the Command's usage
protected
string
$usage
= 'namespaces'
Methods
__construct()
public
__construct(LoggerInterface $logger, Commands $commands) : mixed
Parameters
- $logger : LoggerInterface
- $commands : Commands
__get()
Makes it simple to access our protected properties.
public
__get(string $key) : array<string, string>|Commands|LoggerInterface|string|null
Parameters
- $key : string
Return values
array<string, string>|Commands|LoggerInterface|string|null__isset()
Makes it simple to check our protected properties.
public
__isset(string $key) : bool
Parameters
- $key : string
Return values
boolgetPad()
Get pad for $key => $value array output
public
getPad(array<string, string> $array, int $pad) : int
Use setPad() instead.
Parameters
- $array : array<string, string>
- $pad : int
Tags
Return values
intrun()
Displays the help for the spark cli script itself.
public
run(array<string|int, mixed> $params) : int|void
Parameters
- $params : array<string|int, mixed>
Return values
int|voidsetPad()
Pads our string out so that all titles are the same length to nicely line up descriptions.
public
setPad(string $item, int $max[, int $extra = 2 ][, int $indent = 0 ]) : string
Parameters
- $item : string
- $max : int
- $extra : int = 2
-
How many extra spaces to add at the end
- $indent : int = 0
Return values
stringshowHelp()
Show Help includes (Usage, Arguments, Description, Options).
public
showHelp() : void
call()
Can be used by a command to run other commands.
protected
call(string $command[, array<int|string, string|null> $params = [] ]) : int|void
Parameters
- $command : string
- $params : array<int|string, string|null> = []
Tags
Return values
int|voidshowError()
A simple method to display an error with line/file, in child commands.
protected
showError(Throwable $e) : void
Parameters
- $e : Throwable
outputAllNamespaces()
private
outputAllNamespaces(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Return values
array<string|int, mixed>outputCINamespaces()
private
outputCINamespaces(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Return values
array<string|int, mixed>truncate()
private
truncate(string $string, int $max) : string
Parameters
- $string : string
- $max : int