1 | <?php |
||
25 | abstract class AbstractEnumTwigExtension extends AbstractExtension |
||
26 | { |
||
27 | /** @var string[]|AbstractEnumType[] */ |
||
28 | protected $registeredEnumTypes = []; |
||
29 | |||
30 | /** @var string[]|AbstractEnumType[] */ |
||
31 | protected $occurrences = []; |
||
32 | |||
33 | /** |
||
34 | * @param mixed[] $registeredTypes |
||
35 | */ |
||
36 | public function __construct(array $registeredTypes) |
||
45 | |||
46 | /** |
||
47 | * @return bool |
||
48 | */ |
||
49 | protected function hasRegisteredEnumTypes(): bool |
||
53 | |||
54 | /** |
||
55 | * @return bool |
||
56 | */ |
||
57 | protected function onlyOneOccurrenceFound(): bool |
||
61 | |||
62 | /** |
||
63 | * @return bool |
||
64 | */ |
||
65 | protected function moreThanOneOccurrenceFound(): bool |
||
69 | |||
70 | /** |
||
71 | * @return NoRegisteredEnumTypesException |
||
72 | */ |
||
73 | protected function createNoRegisteredEnumTypesException(): NoRegisteredEnumTypesException |
||
77 | |||
78 | /** |
||
79 | * @param string $enumType |
||
80 | * |
||
81 | * @throws EnumTypeIsNotRegisteredException |
||
82 | */ |
||
83 | protected function throwExceptionIfEnumTypeIsNotRegistered(string $enumType): void |
||
89 | } |
||
90 |