| Total Complexity | 7 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 29.4% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class TextView implements View |
||
| 12 | { |
||
| 13 | private string $name; |
||
| 14 | private array $options; |
||
| 15 | private ?Closure $dataTransformer; |
||
| 16 | |||
| 17 | 1 | public function __construct(string $name, array $options = [], ?Closure $dataTransformer = null) |
|
| 22 | 1 | } |
|
| 23 | |||
| 24 | public function getName(): string |
||
| 25 | { |
||
| 26 | return $this->name; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getOptions(): array |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getOption(string $name) |
||
| 35 | { |
||
| 36 | if (!\array_key_exists($name, $this->options)) { |
||
| 37 | throw new Exception('Invalid option "'.$name.'" for field "'.$this->getName().'"'); |
||
| 38 | } |
||
| 39 | |||
| 40 | return $this->options[$name]; |
||
| 41 | } |
||
| 42 | |||
| 43 | public function getTemplate(): string |
||
| 46 | } |
||
| 47 | |||
| 48 | public function getDataTransformer(): ?Closure |
||
| 53 |