Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
66.67% |
2 / 3 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| IsDefaultable | |
66.67% |
2 / 3 |
|
50.00% |
1 / 2 |
2.15 | |
0.00% |
0 / 1 |
| default | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getDefault | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Cosray\Field\Capability; |
| 6 | |
| 7 | trait IsDefaultable |
| 8 | { |
| 9 | protected mixed $default = null; |
| 10 | |
| 11 | public function default(mixed $default): static |
| 12 | { |
| 13 | $this->default = $default; |
| 14 | |
| 15 | return $this; |
| 16 | } |
| 17 | |
| 18 | public function getDefault(): mixed |
| 19 | { |
| 20 | return $this->default; |
| 21 | } |
| 22 | } |