PendingTransportOperations   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 41
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 4 1
A addAll() 0 6 2
A getOperations() 0 4 1
A hasOperations() 0 4 1
1
<?php
2
namespace PSB\Core\Pipeline;
3
4
5
use PSB\Core\Transport\TransportOperation;
6
7
class PendingTransportOperations
8
{
9
    /**
10
     * @var TransportOperation[]
11
     */
12
    private $operations = [];
13
14
    /**
15
     * @param TransportOperation $transportOperation
16
     */
17 7
    public function add(TransportOperation $transportOperation)
18
    {
19 7
        $this->operations[] = $transportOperation;
20 7
    }
21
22
    /**
23
     * @param array $transportOperations
24
     */
25 1
    public function addAll(array $transportOperations)
26
    {
27 1
        foreach ($transportOperations as $transportOperation) {
28 1
            $this->add($transportOperation);
29
        }
30 1
    }
31
32
    /**
33
     * @return TransportOperation[]
34
     */
35 4
    public function getOperations()
36
    {
37 4
        return $this->operations;
38
    }
39
40
    /**
41
     * @return bool
42
     */
43 5
    public function hasOperations()
44
    {
45 5
        return count($this->operations) > 0;
46
    }
47
}
48