InteractsWithIO
Properties
$input Symfony\...\InputInterface
The input interface implementation.
$verbosity int
The default verbosity of output commands.
$verbosityMap array
The mapping between human readable verbosity levels and Symfony's OutputInterface.
Methods
hasArgument ( $name ) : bool
Determine if the given argument is present.
Parameters
- $name string|int
argument ( $key ) : array|string|bool|null
Get the value of a command argument.
Parameters
- $key string|null
arguments ( ) : array
Get all of the arguments passed to the command.
hasOption ( $name ) : bool
Determine if the given option is present.
Parameters
- $name string
option ( $key ) : string|array|bool|null
Get the value of a command option.
Parameters
- $key string|null
options ( ) : array
Get all of the options passed to the command.
confirm ( $question , $default ) : bool
Confirm a question with the user.
Parameters
- $question string
- $default bool
ask ( $question , $default ) : mixed
Prompt the user for input.
Parameters
- $question string
- $default string|null
anticipate ( $question , $choices , $default ) : mixed
Prompt the user for input with auto completion.
Parameters
- $question string
- $choices array|callable
- $default string|null
askWithCompletion ( $question , $choices , $default ) : mixed
Prompt the user for input with auto completion.
Parameters
- $question string
- $choices array|callable
- $default string|null
secret ( $question , $fallback ) : mixed
Prompt the user for input but hide the answer from the console.
Parameters
- $question string
- $fallback bool
choice ( $question , array $choices , $default , $attempts , $multiple ) : string|array
Give the user a single choice from an array of answers.
Parameters
- $question string
- $choices array
- $default string|int|null
- $attempts mixed|null
- $multiple bool
table ( $headers , $rows , $tableStyle , array $columnStyles ) : void
Format input to textual table.
Parameters
- $headers array
- $rows Illuminate\...\Arrayable|array
- $tableStyle Symfony\...\TableStyle|string
- $columnStyles array
withProgressBar ( $totalSteps , Closure $callback ) : mixed|void
Execute a given callback while advancing a progress bar.
Parameters
- $totalSteps iterable|int
- $callback Closure
info ( $string , $verbosity ) : void
Write a string as information output.
Parameters
- $string string
- $verbosity int|string|null
line ( $string , $style , $verbosity ) : void
Write a string as standard output.
Parameters
- $string string
- $style string|null
- $verbosity int|string|null
comment ( $string , $verbosity ) : void
Write a string as comment output.
Parameters
- $string string
- $verbosity int|string|null
question ( $string , $verbosity ) : void
Write a string as question output.
Parameters
- $string string
- $verbosity int|string|null
error ( $string , $verbosity ) : void
Write a string as error output.
Parameters
- $string string
- $verbosity int|string|null
warn ( $string , $verbosity ) : void
Write a string as warning output.
Parameters
- $string string
- $verbosity int|string|null
alert ( $string , $verbosity ) : void
Write a string in an alert box.
Parameters
- $string string
- $verbosity int|string|null
newLine ( $count ) : $this
Write a blank line.
Parameters
- $count int
setInput ( Symfony\...\InputInterface $input ) : void
Set the input interface implementation.
Parameters
- $input Symfony\...\InputInterface
setOutput ( OutputStyle $output ) : void
Set the output interface implementation.
Parameters
- $output OutputStyle
setVerbosity ( $level ) : void
Set the verbosity level.
Parameters
- $level string|int
parseVerbosity ( $level ) : int
Get the verbosity level in terms of Symfony's OutputInterface level.
Parameters
- $level string|int|null