Completed
Push — master ( 7ec665...146f6b )
by personal
08:22 queued 05:17
created

ExtensionService   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRepository() 0 4 1
A receive() 0 7 2
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
}