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