Total Complexity | 6 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 56.25% |
Changes | 0 |
1 | <?php |
||
11 | class ChainFactory extends AbstractDeclarationBasedFactory |
||
12 | { |
||
13 | /** |
||
14 | * @return \Aoe\Asdis\Content\Scraper\Chain |
||
15 | */ |
||
16 | 1 | public function buildChain() |
|
17 | { |
||
18 | 1 | $this->initialize(); |
|
19 | /** @var \Aoe\Asdis\Content\Scraper\Chain $chain */ |
||
20 | 1 | $chain = $this->objectManager->get(Chain::class); |
|
|
|||
21 | 1 | foreach($this->configurationProvider->getScraperKeys() as $scraperKey) { |
|
22 | $chain->append($this->buildScraper($scraperKey)); |
||
23 | } |
||
24 | 1 | return $chain; |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return void |
||
29 | */ |
||
30 | 1 | private function initialize() |
|
31 | { |
||
32 | 1 | $this->setDeclarations($this->getScraperDeclarations()); |
|
33 | 1 | $this->setClassImplements(['Aoe\Asdis\Content\Scraper\ScraperInterface']); |
|
34 | 1 | } |
|
35 | |||
36 | /** |
||
37 | * @param string $scraperKey |
||
38 | * @return \Aoe\Asdis\Content\Scraper\ScraperInterface |
||
39 | */ |
||
40 | private function buildScraper($scraperKey) |
||
41 | { |
||
42 | return $this->buildObjectFromKey($scraperKey); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return array |
||
47 | */ |
||
48 | protected function getScraperDeclarations() |
||
54 | } |
||
55 | } |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.