| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class GetterBuilder extends AbstractBuilder |
||
| 8 | { |
||
| 9 | use TypeHintTrait; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @param array[] $data |
||
| 13 | * @param array $config |
||
| 14 | */ |
||
| 15 | 22 | public function __construct(array $data, array $config = []) |
|
| 16 | { |
||
| 17 | 22 | $name = (string)array_key_first($data); |
|
| 18 | 22 | $typehint = $this->guessTypeHint($data[$name]); |
|
| 19 | 22 | $getter = $this->getPascalCase($name); |
|
| 20 | |||
| 21 | 22 | $_data = \compact('name', 'typehint', 'getter'); |
|
| 22 | |||
| 23 | 22 | parent::__construct($_data, $config); |
|
| 24 | 22 | } |
|
| 25 | |||
| 26 | 22 | public function getFileTemplate(): string |
|
| 27 | { |
||
| 28 | 22 | return 'Getter.php.twig'; |
|
| 29 | } |
||
| 30 | |||
| 31 | 22 | public function getPathTemplate(): string |
|
| 34 | } |
||
| 35 | |||
| 36 | 22 | public function build(): string |
|
| 39 | } |
||
| 40 | } |
||
| 41 |