| Total Complexity | 6 |
| Total Lines | 85 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | trait FieldViewTrait |
||
| 13 | { |
||
| 14 | use RenderableTrait; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $name; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var mixed |
||
| 23 | */ |
||
| 24 | private $value; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var bool |
||
| 28 | */ |
||
| 29 | private $required = false; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var array |
||
| 33 | */ |
||
| 34 | private $constraints = []; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var ChoiceView[]|null |
||
| 38 | */ |
||
| 39 | private $choices; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * {@inheritdoc} |
||
| 43 | */ |
||
| 44 | 81 | public function name(): string |
|
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | 67 | public function value() |
|
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * {@inheritdoc} |
||
| 59 | */ |
||
| 60 | 77 | public function required(): bool |
|
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * {@inheritdoc} |
||
| 67 | */ |
||
| 68 | 66 | public function constraints(): array |
|
| 69 | { |
||
| 70 | 66 | return $this->constraints; |
|
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * {@inheritdoc} |
||
| 75 | * |
||
| 76 | * @return array<array-key, ChoiceView>|null |
||
|
|
|||
| 77 | */ |
||
| 78 | 14 | public function choices(): ?array |
|
| 81 | } |
||
| 82 | |||
| 83 | /** |
||
| 84 | * {@inheritdoc} |
||
| 85 | */ |
||
| 86 | 43 | public function render(FieldViewRendererInterface $renderer = null): string |
|
| 89 | } |
||
| 90 | |||
| 91 | /** |
||
| 92 | * Get the default renderer to use for the current view implementation |
||
| 93 | * |
||
| 94 | * @return FieldViewRendererInterface |
||
| 95 | */ |
||
| 96 | abstract protected function defaultRenderer(): FieldViewRendererInterface; |
||
| 97 | } |
||
| 98 |