Documentation

Ask
in package
implements InteractiveAttributeInterface

Attributes
#[Attribute]
\Attribute::TARGET_PARAMETER | \Attribute::TARGET_PROPERTY

Table of Contents

Interfaces

InteractiveAttributeInterface

Properties

$default  : string|bool|int|float|null
$hidden  : bool
$maxAttempts  : int|null
$multiline  : bool
$normalizer  : Closure|null
$question  : string
$timeout  : int|null
$trimmable  : bool
$validator  : Closure|null
$closure  : Closure

Methods

__construct()  : mixed

Properties

$default

public string|bool|int|float|null $default = null

$hidden

public bool $hidden = false

$maxAttempts

public int|null $maxAttempts = null

$multiline

public bool $multiline = false

$normalizer

public Closure|null $normalizer

$question

public string $question

$timeout

public int|null $timeout = null

$trimmable

public bool $trimmable = true

$validator

public Closure|null $validator

$closure

private Closure $closure

Methods

__construct()

public __construct(string $question[, string|bool|int|float|null $default = null ][, bool $hidden = false ][, bool $multiline = false ][, bool $trimmable = true ][, int|null $timeout = null ][, callable|null $normalizer = null ][, callable|null $validator = null ][, int|null $maxAttempts = null ]) : mixed
Parameters
$question : string

The question to ask the user

$default : string|bool|int|float|null = null

The default answer to return if the user enters nothing

$hidden : bool = false

Whether the user response must be hidden or not

$multiline : bool = false

Whether the user response should accept newline characters

$trimmable : bool = true

Whether the user response must be trimmed or not

$timeout : int|null = null

The maximum time the user has to answer the question in seconds

$normalizer : callable|null = null
$validator : callable|null = null

The validator for the question

$maxAttempts : int|null = null

The maximum number of attempts allowed to answer the question. Null means an unlimited number of attempts


        
On this page

Search results