TransportOperations   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A add() 0 4 1
A getTransportOperations() 0 4 1
1
<?php
2
namespace PSB\Core\Transport;
3
4
5
class TransportOperations
6
{
7
    /**
8
     * @var TransportOperation[]
9
     */
10
    private $transportOperations = [];
11
12
    /**
13
     * @param TransportOperation[] $transportOperations
14
     */
15 4
    public function __construct(array $transportOperations)
16
    {
17 4
        foreach ($transportOperations as $transportOperation) {
18 2
            $this->add($transportOperation);
19
        }
20 3
    }
21
22
    /**
23
     * @param TransportOperation $transportOperation
24
     */
25 1
    private function add(TransportOperation $transportOperation)
26
    {
27 1
        $this->transportOperations[] = $transportOperation;
28 1
    }
29
30
    /**
31
     * @return TransportOperation[]
32
     */
33 1
    public function getTransportOperations()
34
    {
35 1
        return $this->transportOperations;
36
    }
37
}
38