final class Options

The command and the option values given on the command line.

Properties§

public string $command
public array<string, string|bool> $values

Methods§

public function __construct(public string $command, public array<string, string|bool> $values)

Parameters

$commandstringThe command name
$valuesarray<string, string|bool>Option values by option name
public static function fromInput(string $command, InputInterface $input): self

Reads the global options and the options of a command.

Parameters

$commandstringThe command name
$inputInputInterfaceThe parsed command line

Returns

self The options
Test cases 3
Called from 1
Calls 6
public static function definitions(string $command): list<array{string, bool, string}>
public function text(string $name, string|null $default = null): string|null
public function percentage(string $name): float|null

Returns a percentage option.

Parameters

$namestringThe option name

Returns

float|null The percentage, or null when the option is not given

Throws

InvalidInputException When the value is not a number from 0 to 100
Test cases 2
Called from 1
Calls 4
public function matches(Item $item): bool

Tells whether an item passes the spec filters.

Parameters

$itemItemThe item

Returns

bool True when the item has every given ID, category, status, kind, origin, source and label, and no source under --without-source
Test cases 2
Called from 1
Calls 3

Test cases 40§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 10
Other tests reaching this symbol 30

Relations§

Static calls 2
Method calls 14
Type declarations 4