abstract class CompletionResponse implements Arrayable

Constants

protected MAX_VALUES

Methods

__construct(array $values, bool $hasMore = false, int|null $total = null)

Create a completion response.

empty()

Create an empty completion response.

match(array|string $items)

Create completions to match against an argument prefix.

result(array|string $items)

Create a response containing the given completions.

resolve(string $value)

Resolve completions for an argument value.

array
values()

Get the completion values.

bool
hasMore()

Determine whether more completions are available.

array
toArray()

Convert the completion response to an array.

Details

at line 23
__construct(array $values, bool $hasMore = false, int|null $total = null)

Create a completion response.

Parameters

array $values
bool $hasMore
int|null $total

at line 40
static CompletionResponse empty()

Create an empty completion response.

Return Value

CompletionResponse

at line 50
static CompletionResponse match(array|string $items)

Create completions to match against an argument prefix.

Parameters

array|string $items

Return Value

CompletionResponse

at line 64
static CompletionResponse result(array|string $items)

Create a response containing the given completions.

Parameters

array|string $items

Return Value

CompletionResponse

at line 80
abstract CompletionResponse resolve(string $value)

Resolve completions for an argument value.

Parameters

string $value

Return Value

CompletionResponse

at line 87
array values()

Get the completion values.

Return Value

array

at line 95
bool hasMore()

Determine whether more completions are available.

Return Value

bool

at line 105
array toArray()

Convert the completion response to an array.

Return Value

array