| Total Complexity | 7 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 84.21% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | trait HasTypeTrait |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | protected $type = null; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @return string |
||
| 20 | */ |
||
| 21 | 2 | public function getType() |
|
| 22 | { |
||
| 23 | 2 | if ($this->type === null) { |
|
| 24 | 2 | $this->initType(); |
|
| 25 | } |
||
| 26 | |||
| 27 | 2 | return $this->type; |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $type |
||
| 32 | * @return $this |
||
| 33 | */ |
||
| 34 | 2 | public function setType($type) |
|
| 35 | { |
||
| 36 | 2 | $this->type = $type; |
|
| 37 | |||
| 38 | 2 | return $this; |
|
| 39 | } |
||
| 40 | |||
| 41 | 2 | protected function initType() |
|
| 44 | 2 | } |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | 2 | protected function generateType() |
|
| 65 |