Environment
        
        extends BaseCommand
    
    
            
            in package
            
        
    
    
    
Command to display the current environment, or set a new one in the `.env` file.
Table of Contents
Properties
- $commands : Commands
- $logger : LoggerInterface
- $arguments : array<string, string>
- The Command's arguments
- $description : string
- The Command's short description
- $group : string
- The group the command is lumped under when listing commands.
- $name : string
- The Command's name
- $options : array<string, string>
- The Command's options
- $usage : string
- The Command's usage
- $knownTypes : array<int, string>
- Allowed values for environment. `testing` is excluded since spark won't work on it.
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
- Actually execute a command.
- 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.
- writeNewEnvironmentToEnvFile() : bool
Properties
$commands
        public
            Commands
    $commands
    
    
    
    
    
    
$logger
        public
            LoggerInterface
    $logger
    
    
    
    
    
    
$arguments
The Command's arguments
        protected
            array<string, string>
    $arguments
     = ['environment' => '[Optional] The new environment to set. If none is provided, this will print the current environment.']
    
    
    
    
    
$description
The Command's short description
        protected
            string
    $description
     = 'Retrieves the current environment, or set a new one.'
    
    
    
    
    
$group
The group the command is lumped under when listing commands.
        protected
            string
    $group
     = 'CodeIgniter'
    
    
    
    
    
$name
The Command's name
        protected
            string
    $name
     = 'env'
    
    
    
    
    
$options
The Command's options
        protected
            array<string, string>
    $options
     = []
    
    
    
    
    
$usage
The Command's usage
        protected
            string
    $usage
     = 'env [<environment>]'
    
    
    
    
    
$knownTypes
Allowed values for environment. `testing` is excluded since spark won't work on it.
        private
        static    array<int, string>
    $knownTypes
     = ['production', 'development']
    
    
    
    
    
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()
Actually execute a command.
    public
                    run(array<string|int, mixed> $params) : int
    Parameters
- $params : array<string|int, mixed>
Return values
intsetPad()
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
writeNewEnvironmentToEnvFile()
    private
                    writeNewEnvironmentToEnvFile(string $newEnv) : bool
    Parameters
- $newEnv : string