Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 85.71% |
Changes | 0 |
1 | <?php |
||
11 | class ChainFactory extends AbstractDeclarationBasedFactory |
||
12 | { |
||
13 | /** |
||
14 | * @return \Aoe\Asdis\System\Uri\Filter\Chain |
||
15 | */ |
||
16 | 1 | public function buildChain() |
|
17 | { |
||
18 | 1 | $this->initialize(); |
|
19 | /** @var \Aoe\Asdis\System\Uri\Filter\Chain $chain */ |
||
20 | 1 | $chain = new Chain(); |
|
21 | 1 | foreach ($this->configurationProvider->getFilterKeys() as $filterKey) { |
|
22 | 1 | $chain->append($this->buildFilter($filterKey)); |
|
23 | } |
||
24 | 1 | return $chain; |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return void |
||
29 | */ |
||
30 | 1 | private function initialize() |
|
31 | { |
||
32 | 1 | $this->setDeclarations($this->getDeclarations()); |
|
33 | 1 | $this->setClassImplements([FilterInterface::class]); |
|
34 | 1 | } |
|
35 | |||
36 | /** |
||
37 | * @param string $filterKey |
||
38 | * @return \Aoe\Asdis\System\Uri\Filter\FilterInterface |
||
39 | */ |
||
40 | 1 | private function buildFilter($filterKey) |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return array |
||
47 | */ |
||
48 | protected function getDeclarations() |
||
51 | } |
||
52 | } |