CalculateScore::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
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\Command\Job;
11
use Hal\Component\Score\ScoringInterface;
12
use Hal\Component\Result\ResultCollection;
13
14
15
/**
16
 * Job report renderer
17
 *
18
 * @author Jean-François Lépine <https://twitter.com/Halleck45>
19
 */
20
class CalculateScore implements JobInterface
21
{
22
23
    /**
24
     * @var ScoringInterface
25
     */
26
    private $scoring;
27
28
    /**
29
     * Constructor
30
     *
31
     * @param $scoring
32
     */
33
    public function __construct(ScoringInterface $scoring)
34
    {
35
        $this->scoring = $scoring;
36
    }
37
38
39
    /**
40
     * @inheritdoc
41
     */
42
    public function execute(ResultCollection $collection, ResultCollection $aggregatedResults) {
43
        $score = $this->scoring->calculate($collection, $aggregatedResults);
44
        $collection->setScore($score);
45
    }
46
47
}
48