| Total Complexity | 5 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | trait HasInitial |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | protected $initial = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param string|null $key |
||
| 16 | * @return array|mixed |
||
| 17 | */ |
||
| 18 | 4 | public function getInitial($key = null) |
|
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @return static |
||
| 29 | */ |
||
| 30 | 12 | public function setInitial(array $initial) |
|
| 31 | { |
||
| 32 | 12 | $this->initial = $initial; |
|
| 33 | |||
| 34 | 12 | return $this; |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param string|null $key |
||
| 39 | */ |
||
| 40 | 4 | public function hasInitial($key = null): bool |
|
| 47 | } |
||
| 48 | } |
||
| 49 |