TransportOperations::add()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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