Passed
Push — master ( 3f26c1...e5a362 )
by Nicolas
04:09 queued 01:57
created

PlanProvider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Cp\Provider;
4
5
use Cp\DomainObject\Configuration;
6
use Cp\DomainObject\Plan;
7
use Cp\Manager\PlanManager;
8
9
/**
10
 * Class PlanProvider
11
 */
12
class PlanProvider
13
{
14
    /**
15
     * @var PlanManager
16
     */
17
    private $planManager;
18
19
    /**
20
     * PlanProvider constructor.
21
     *
22
     * @param PlanManager $planManager
23
     */
24 1
    public function __construct(PlanManager $planManager)
25
    {
26 1
        $this->planManager = $planManager;
27 1
    }
28
29
    /**
30
     * @param Configuration $configuration
31
     *
32
     * @return Plan
33
     */
34 1
    public function getPlanByConfiguration(Configuration $configuration)
35
    {
36 1
        return $this->planManager->findByType(
37 1
            $configuration->getNumberOfWeek(),
38 1
            $configuration->getNumberOfSeance(),
39 1
            $configuration->getType()
40 1
        );
41
    }
42
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
43