Completed
Pull Request — master (#202)
by personal
03:02
created

ExtensionService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * (c) Jean-François Lépine <https://twitter.com/Halleck45>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Hal\Application\Extension;
11
12
use Hal\Application\Config\Configuration;
13
use Hal\Component\Bounds\Bounds;
14
use Hal\Component\Result\ResultCollection;
15
16
class ExtensionService {
17
18
    /**
19
     * @var Repository
20
     */
21
   private $repository;
22
23
    /**
24
     * ExtensionService constructor.
25
     * @param Repository $repository
26
     */
27
    public function __construct(Repository $repository)
28
    {
29
        $this->repository = $repository;
30
    }
31
32
    /**
33
     * @return Repository
34
     */
35
    public function getRepository()
36
    {
37
        return $this->repository;
38
    }
39
40
    /**
41
     * @param Configuration $config
42
     * @param ResultCollection $collection
43
     * @param ResultCollection $aggregatedResults
44
     * @param Bounds $bounds
45
     * @return mixed
46
     */
47
    public function receive(Configuration $config, ResultCollection $collection, ResultCollection $aggregatedResults, Bounds $bounds)
48
    {
49
        // search controller
50
        foreach($this->repository->all() as $item) {
51
            $item->receive($config, $collection, $aggregatedResults, $bounds);
52
        }
53
    }
54
}