Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Param | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App; |
| 4 | |
| 5 | use Attribute; |
| 6 | |
| 7 | /** |
| 8 | * Attribut parameters |
| 9 | * Allows you to describe a parameter, by defining a type, a description of the value |
| 10 | * and a description of the parameter. |
| 11 | */ |
| 12 | #[Attribute(Attribute::TARGET_PROPERTY)] |
| 13 | final class Param |
| 14 | { |
| 15 | public const INPUT = 'input'; |
| 16 | public const TEXTAREA = 'textarea'; |
| 17 | public const RADIO = 'radio'; |
| 18 | |
| 19 | public ?string $description; |
| 20 | public ?string $valeur; |
| 21 | public bool $readOnly; |
| 22 | public ?string $type; |
| 23 | |
| 24 | public function __construct( |
| 25 | ?string $description = null, |
| 26 | ?string $valeur = null, |
| 27 | bool $readOnly = false, |
| 28 | string $type = self::INPUT, |
| 29 | ) { |
| 30 | $this->description = $description; |
| 31 | $this->valeur = $valeur; |
| 32 | $this->readOnly = $readOnly; |
| 33 | $this->type = $type; |
| 34 | } |
| 35 | } |