| Total Complexity | 3 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 5 | class Computed |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string |
||
| 9 | */ |
||
| 10 | public $name; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | public $code; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | public $type = null; |
||
| 21 | |||
| 22 | public function __construct(string $name, string $type = '', string $code = '') |
||
| 23 | { |
||
| 24 | $this->name = $name; |
||
| 25 | $this->code = $code; |
||
| 26 | $this->type = $type; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function toGetter(): string |
||
| 30 | { |
||
| 31 | return "get {$this->name}() { $this->code }"; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function toStruct(): string |
||
| 37 | } |
||
| 38 | } |
||
| 39 |