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

PlanProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 31
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getPlanByConfiguration() 0 8 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