| Total Complexity | 2 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 21 | trait Required |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var bool |
||
| 25 | */ |
||
| 26 | private $required = false; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Check if field is required. |
||
| 30 | * |
||
| 31 | * @return bool |
||
| 32 | */ |
||
| 33 | 146 | public function isRequired(): bool |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Set if field is required. |
||
| 40 | * |
||
| 41 | * @param bool $required |
||
| 42 | * |
||
| 43 | * @return static |
||
| 44 | */ |
||
| 45 | 506 | public function setRequired(bool $required): self |
|
| 52 |