Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Arg | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Celema\Console; |
| 6 | |
| 7 | use Attribute; |
| 8 | |
| 9 | /** |
| 10 | * Declares an `__invoke()` parameter as a positional argument. |
| 11 | * |
| 12 | * The argument takes its name from the parameter, converted to kebab-case: |
| 13 | * `$targetDir` renders as `<target-dir>`. Positionals are matched to the |
| 14 | * arguments in declaration order and converted to the declared type: |
| 15 | * `string`, `int`, `float`, or a backed enum. A parameter with a default |
| 16 | * is optional and renders as `[<name>]`. |
| 17 | * |
| 18 | * An `array` parameter must be the last argument and takes the remaining |
| 19 | * positionals as strings: at least one, or any number when it has a |
| 20 | * default. It renders as `<name>...`. |
| 21 | * |
| 22 | * @api |
| 23 | */ |
| 24 | #[Attribute(Attribute::TARGET_PARAMETER)] |
| 25 | final class Arg |
| 26 | { |
| 27 | public function __construct( |
| 28 | public readonly string $description = '', |
| 29 | ) {} |
| 30 | } |