Menu

## InteractsWithIO

InteractsWithIO.php : 16

### Table of Contents

#### Properties

$input : InputInterface
  The input interface implementation.
$output : OutputStyle
  The output interface implementation.
$verbosity : int
  The default verbosity of output commands.
$verbosityMap : array<string|int, mixed>
  The mapping between human readable verbosity levels and Symfony's OutputInterface.

#### Methods

alert() : void
  Write a string in an alert box.
anticipate() : mixed
  Prompt the user for input with auto completion.
argument() : array<string|int, mixed>|string|bool|null
  Get the value of a command argument.
arguments() : array<string|int, mixed>
  Get all of the arguments passed to the command.
ask() : mixed
  Prompt the user for input.
askWithCompletion() : mixed
  Prompt the user for input with auto completion.
choice() : string|array<string|int, mixed>
  Give the user a single choice from an array of answers.
comment() : void
  Write a string as comment output.
confirm() : bool
  Confirm a question with the user.
error() : void
  Write a string as error output.
getOutput() : OutputStyle
  Get the output implementation.
hasArgument() : bool
  Determine if the given argument is present.
hasOption() : bool
  Determine if the given option is present.
info() : void
  Write a string as information output.
line() : void
  Write a string as standard output.
newLine() : $this
  Write a blank line.
option() : string|array<string|int, mixed>|bool|null
  Get the value of a command option.
options() : array<string|int, mixed>
  Get all of the options passed to the command.
question() : void
  Write a string as question output.
secret() : mixed
  Prompt the user for input but hide the answer from the console.
setInput() : void
  Set the input interface implementation.
setOutput() : void
  Set the output interface implementation.
table() : void
  Format input to textual table.
warn() : void
  Write a string as warning output.
withProgressBar() : int|iterable<string|int, mixed>|void
  Execute a given callback while advancing a progress bar.
parseVerbosity() : int
  Get the verbosity level in terms of Symfony's OutputInterface level.
setVerbosity() : void
  Set the verbosity level.

### Properties

#### $input

InteractsWithIO.php : 23

The input interface implementation.

`protected InputInterface $input`

#### $output

InteractsWithIO.php : 30

The output interface implementation.

`protected OutputStyle $output`

#### $verbosity

InteractsWithIO.php : 37

The default verbosity of output commands.

`protected int $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL`

#### $verbosityMap

InteractsWithIO.php : 44

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

`protected array<string|int, mixed> $verbosityMap = ['v' => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERBOSE, 'vv' => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERY_VERBOSE, 'vvv' => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_DEBUG, 'quiet' => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_QUIET, 'normal' => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL]`

### Methods

#### alert()

InteractsWithIO.php : 361

Write a string in an alert box.

`public alert(string $string[, int|string|null $verbosity = null ]) : void`

##### Parameters

$string : string
$verbosity : int|string|null = null

#### anticipate()

InteractsWithIO.php : 156

Prompt the user for input with auto completion.

`public anticipate(string $question, callable|array<string|int, mixed> $choices[, string|null $default = null ]) : mixed`

##### Parameters

$question : string
$choices : callable|array<string|int, mixed>
$default : string|null = null

#### argument()

InteractsWithIO.php : 69

Get the value of a command argument.

`public argument([string|null $key = null ]) : array<string|int, mixed>|string|bool|null`

##### Parameters

$key : string|null = null

##### Return values

array<string|int, mixed>|string|bool|null

#### arguments()

InteractsWithIO.php : 83

Get all of the arguments passed to the command.

`public arguments() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### ask()

InteractsWithIO.php : 143

Prompt the user for input.

`public ask(string $question[, string|null $default = null ]) : mixed`

##### Parameters

$question : string
$default : string|null = null

#### askWithCompletion()

InteractsWithIO.php : 169

Prompt the user for input with auto completion.

`public askWithCompletion(string $question, callable|array<string|int, mixed> $choices[, string|null $default = null ]) : mixed`

##### Parameters

$question : string
$choices : callable|array<string|int, mixed>
$default : string|null = null

#### choice()

InteractsWithIO.php : 206

Give the user a single choice from an array of answers.

`public choice(string $question, array<string|int, mixed> $choices[, int|string|null $default = null ][, mixed|null $attempts = null ][, bool $multiple = false ]) : string|array<string|int, mixed>`

##### Parameters

$question : string
$choices : array<string|int, mixed>
$default : int|string|null = null
$attempts : mixed|null = null
$multiple : bool = false

##### Return values

string|array<string|int, mixed>

#### comment()

InteractsWithIO.php : 307

Write a string as comment output.

`public comment(string $string[, int|string|null $verbosity = null ]) : void`

##### Parameters

$string : string
$verbosity : int|string|null = null

#### confirm()

InteractsWithIO.php : 131

Confirm a question with the user.

`public confirm(string $question[, bool $default = false ]) : bool`

##### Parameters

$question : string
$default : bool = false

##### Return values

bool

#### error()

InteractsWithIO.php : 331

Write a string as error output.

`public error(string $string[, int|string|null $verbosity = null ]) : void`

##### Parameters

$string : string
$verbosity : int|string|null = null

#### getOutput()

InteractsWithIO.php : 440

Get the output implementation.

`public getOutput() : OutputStyle`

##### Return values

OutputStyle

#### hasArgument()

InteractsWithIO.php : 58

Determine if the given argument is present.

`public hasArgument(int|string $name) : bool`

##### Parameters

$name : int|string

##### Return values

bool

#### hasOption()

InteractsWithIO.php : 94

Determine if the given option is present.

`public hasOption(string $name) : bool`

##### Parameters

$name : string

##### Return values

bool

#### info()

InteractsWithIO.php : 280

Write a string as information output.

`public info(string $string[, int|string|null $verbosity = null ]) : void`

##### Parameters

$string : string
$verbosity : int|string|null = null

#### line()

InteractsWithIO.php : 293

Write a string as standard output.

`public line(string $string[, string|null $style = null ][, int|string|null $verbosity = null ]) : void`

##### Parameters

$string : string
$style : string|null = null
$verbosity : int|string|null = null

#### newLine()

InteractsWithIO.php : 378

Write a blank line.

`public newLine([int $count = 1 ]) : $this`

##### Parameters

$count : int = 1

##### Return values

$this

#### option()

InteractsWithIO.php : 105

Get the value of a command option.

`public option([string|null $key = null ]) : string|array<string|int, mixed>|bool|null`

##### Parameters

$key : string|null = null

##### Return values

string|array<string|int, mixed>|bool|null

#### options()

InteractsWithIO.php : 119

Get all of the options passed to the command.

`public options() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### question()

InteractsWithIO.php : 319

Write a string as question output.

`public question(string $string[, int|string|null $verbosity = null ]) : void`

##### Parameters

$string : string
$verbosity : int|string|null = null

#### secret()

InteractsWithIO.php : 187

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

`public secret(string $question[, bool $fallback = true ]) : mixed`

##### Parameters

$question : string
$fallback : bool = true

#### setInput()

InteractsWithIO.php : 391

Set the input interface implementation.

`public setInput(InputInterface $input) : void`

##### Parameters

$input : InputInterface

#### setOutput()

InteractsWithIO.php : 402

Set the output interface implementation.

`public setOutput(OutputStyle $output) : void`

##### Parameters

$output : OutputStyle

#### table()

InteractsWithIO.php : 224

Format input to textual table.

`public table(array<string|int, mixed> $headers, array<string|int, mixed>|Arrayable $rows[, string|TableStyle $tableStyle = 'default' ][, array<string|int, mixed> $columnStyles = [] ]) : void`

##### Parameters

$headers : array<string|int, mixed>
$rows : array<string|int, mixed>|Arrayable
$tableStyle : string|TableStyle = 'default'
$columnStyles : array<string|int, mixed> = []

#### warn()

InteractsWithIO.php : 343

Write a string as warning output.

`public warn(string $string[, int|string|null $verbosity = null ]) : void`

##### Parameters

$string : string
$verbosity : int|string|null = null

#### withProgressBar()

InteractsWithIO.php : 248

Execute a given callback while advancing a progress bar.

`public withProgressBar(iterable<string|int, mixed>|int $totalSteps, Closure $callback) : int|iterable<string|int, mixed>|void`

##### Parameters

$totalSteps : iterable<string|int, mixed>|int
$callback : Closure

##### Return values

int|iterable<string|int, mixed>|void

#### parseVerbosity()

InteractsWithIO.php : 424

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

`protected parseVerbosity([int|string|null $level = null ]) : int`

##### Parameters

$level : int|string|null = null

##### Return values

int

#### setVerbosity()

InteractsWithIO.php : 413

Set the verbosity level.

`protected setVerbosity(int|string $level) : void`

##### Parameters

$level : int|string

## Search results