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