| Total Complexity | 5 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | trait HasName |
||
| 10 | { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $name = null; |
||
| 16 | |||
| 17 | |||
| 18 | /** |
||
| 19 | * @return mixed |
||
| 20 | */ |
||
| 21 | public function getName(): ?string |
||
| 22 | { |
||
| 23 | if ($this->name === null) { |
||
| 24 | $this->initName(); |
||
| 25 | } |
||
| 26 | |||
| 27 | return $this->name; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param mixed $name |
||
| 32 | */ |
||
| 33 | public function setName($name) |
||
| 36 | } |
||
| 37 | |||
| 38 | protected function initName() |
||
| 48 | } |