Stats   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 29
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getStats() 0 6 1
1
<?php
2
/**
3
 * File: Stats.php
4
 *
5
 * @author      Maciej Sławik <[email protected]>
6
 * Github:      https://github.com/maciejslawik
7
 */
8
9
namespace MSlwk\Otomoto\Middleware\App\Stats;
10
11
use MSlwk\Otomoto\App\Manufacturer\Data\ManufacturerDTOInterface;
12
use MSlwk\Otomoto\App\Model\Data\ModelDTOInterface;
13
use MSlwk\Otomoto\App\Stats\Data\StatsDTOInterface;
14
use MSlwk\Otomoto\App\Stats\Filter\FilterArray;
15
use MSlwk\Otomoto\App\Stats\StatsProvider;
16
17
/**
18
 * Class Stats
19
 * @package MSlwk\Otomoto\Middleware\App\Stats
20
 */
21
class Stats
22
{
23
    /**
24
     * @var StatsProvider
25
     */
26
    private $statsProvider;
27
28
    /**
29
     * Stats constructor.
30
     * @param StatsProvider $statsProvider
31
     */
32 2
    public function __construct(
33
        StatsProvider $statsProvider
34
    ) {
35 2
        $this->statsProvider = $statsProvider;
36 2
    }
37
38
    /**
39
     * @param ManufacturerDTOInterface $manufacturer
40
     * @param ModelDTOInterface $model
41
     * @param FilterArray $filters
42
     * @return StatsDTOInterface
43
     */
44 1
    public function getStats(
45
        ManufacturerDTOInterface $manufacturer,
46
        ModelDTOInterface $model,
47
        FilterArray $filters
48
    ): StatsDTOInterface {
49 1
        return $this->statsProvider->getStats($manufacturer, $model, $filters);
50
    }
51
}
52