TransportOperations::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
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