trait Illuminate / Console / Concerns / InteractsWithIO
You are viewing an older version of the documentation. For the latest, please visit master documentation.

InteractsWithIO

Properties

protected

$input Symfony\...\InputInterface

The input interface implementation.

Default: null
protected

$output OutputStyle

The output interface implementation.

Default: null
protected

$verbosity int

The default verbosity of output commands.

Default: VERBOSITY_NORMAL
protected

$verbosityMap array

The mapping between human readable verbosity levels and Symfony's OutputInterface.

Default: array

Methods

public

hasArgument ( $name ) : bool

Determine if the given argument is present.

Parameters

  • $name string|int
public

argument ( $key ) : string|array|null

Get the value of a command argument.

Parameters

  • $key string|null
public

arguments ( ) : array

Get all of the arguments passed to the command.

public

hasOption ( $name ) : bool

Determine if the given option is present.

Parameters

  • $name string
public

option ( $key ) : string|array|bool|null

Get the value of a command option.

Parameters

  • $key string|null
public

options ( ) : array

Get all of the options passed to the command.

public

confirm ( $question , $default ) : bool

Confirm a question with the user.

Parameters

  • $question string
  • $default bool
public

ask ( $question , $default ) : mixed

Prompt the user for input.

Parameters

  • $question string
  • $default string|null
public

anticipate ( $question , $choices , $default ) : mixed

Prompt the user for input with auto completion.

Parameters

  • $question string
  • $choices array|callable
  • $default string|null
public

askWithCompletion ( $question , $choices , $default ) : mixed

Prompt the user for input with auto completion.

Parameters

  • $question string
  • $choices array|callable
  • $default string|null
public

secret ( $question , $fallback ) : mixed

Prompt the user for input but hide the answer from the console.

Parameters

  • $question string
  • $fallback bool
public

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|null
  • $attempts mixed|null
  • $multiple bool
public

table ( $headers , $rows , $tableStyle , array $columnStyles ) : void

Format input to textual table.

Parameters

  • $headers array
  • $rows Arrayable |array
  • $tableStyle string
  • $columnStyles array
public

withProgressBar ( $totalSteps , Closure $callback ) : mixed|void

Execute a given callback while advancing a progress bar.

Parameters

  • $totalSteps iterable|int
  • $callback Closure
public

info ( $string , $verbosity ) : void

Write a string as information output.

Parameters

  • $string string
  • $verbosity int|string|null
public

line ( $string , $style , $verbosity ) : void

Write a string as standard output.

Parameters

  • $string string
  • $style string|null
  • $verbosity int|string|null
public

comment ( $string , $verbosity ) : void

Write a string as comment output.

Parameters

  • $string string
  • $verbosity int|string|null
public

question ( $string , $verbosity ) : void

Write a string as question output.

Parameters

  • $string string
  • $verbosity int|string|null
public

error ( $string , $verbosity ) : void

Write a string as error output.

Parameters

  • $string string
  • $verbosity int|string|null
public

warn ( $string , $verbosity ) : void

Write a string as warning output.

Parameters

  • $string string
  • $verbosity int|string|null
public

alert ( $string ) : void

Write a string in an alert box.

Parameters

  • $string string
public

newLine ( $count ) : void

Write a blank line.

Parameters

  • $count int
public

setInput ( Symfony\...\InputInterface $input ) : void

Set the input interface implementation.

Parameters

  • $input Symfony\...\InputInterface
public

setOutput ( OutputStyle $output ) : void

Set the output interface implementation.

Parameters

protected

setVerbosity ( $level ) : void

Set the verbosity level.

Parameters

  • $level string|int
protected

parseVerbosity ( $level ) : int

Get the verbosity level in terms of Symfony's OutputInterface level.

Parameters

  • $level string|int|null
public

getOutput ( ) : OutputStyle

Get the output implementation.