1 | <?php |
||
21 | final class HeaderCheckerManagerFactory |
||
22 | { |
||
23 | /** |
||
24 | * @var EventDispatcherInterface |
||
25 | */ |
||
26 | private $eventDispatcher; |
||
27 | |||
28 | /** |
||
29 | * @var HeaderChecker[] |
||
30 | */ |
||
31 | private $checkers = []; |
||
32 | |||
33 | /** |
||
34 | * @var TokenTypeSupport[] |
||
35 | */ |
||
36 | private $tokenTypes = []; |
||
37 | |||
38 | public function __construct(EventDispatcherInterface $eventDispatcher) |
||
42 | |||
43 | /** |
||
44 | * This method creates a Header Checker Manager and populate it with the header parameter checkers found based on the alias. |
||
45 | * If the alias is not supported, an InvalidArgumentException is thrown. |
||
46 | * |
||
47 | * @param string[] $aliases |
||
48 | * |
||
49 | * @throws InvalidArgumentException if an alias is not supported |
||
50 | */ |
||
51 | public function create(array $aliases): HeaderCheckerManager |
||
63 | |||
64 | /** |
||
65 | * This method adds a header parameter checker to this factory. |
||
66 | * The checker is uniquely identified by an alias. This allows the same header parameter checker to be added twice (or more) |
||
67 | * using several configuration options. |
||
68 | */ |
||
69 | public function add(string $alias, HeaderChecker $checker): void |
||
73 | |||
74 | /** |
||
75 | * This method adds a token type support to this factory. |
||
76 | */ |
||
77 | public function addTokenTypeSupport(TokenTypeSupport $tokenType): void |
||
81 | |||
82 | /** |
||
83 | * Returns all header parameter checker aliases supported by this factory. |
||
84 | * |
||
85 | * @return string[] |
||
86 | */ |
||
87 | public function aliases(): array |
||
91 | |||
92 | /** |
||
93 | * Returns all header parameter checkers supported by this factory. |
||
94 | * |
||
95 | * @return HeaderChecker[] |
||
96 | */ |
||
97 | public function all(): array |
||
101 | } |
||
102 |