Map   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 11
Bugs 0 Features 4
Metric Value
c 11
b 0
f 4
dl 0
loc 30
wmc 4
lcom 1
cbo 0
ccs 10
cts 10
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A getMappings() 0 4 1
A addMapping() 0 4 1
1
<?php
2
3
namespace Cascade\Mapper\Map;
4
5
use Cascade\Mapper\Mapping\MappingInterface;
6
7
class Map implements MapInterface
8
{
9
    /**
10
     * @var MappingInterface[]
11
     */
12
    private $mappings = [];
13
14
    /**
15
     * @param MappingInterface[] $mappings
16
     */
17 5
    public function __construct($mappings)
18
    {
19 5
        foreach ($mappings as $mapping) {
20 5
            $this->addMapping($mapping);
21 5
        }
22 5
    }
23
24 5
    public function getMappings()
25
    {
26 5
        return $this->mappings;
27
    }
28
29
    /**
30
     * @param MappingInterface $mapping
31
     */
32 5
    private function addMapping(MappingInterface $mapping)
33
    {
34 5
        $this->mappings[] = $mapping;
35 5
    }
36
}
37