Conditions | 7 |
Paths | 6 |
Total Lines | 27 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 7 |
Changes | 0 |
1 | <?php |
||
41 | 3 | private function isContainerPropertyValid($oContainer) |
|
42 | { |
||
43 | 3 | if (is_null($oContainer)) |
|
44 | 3 | { |
|
45 | 2 | return true; |
|
46 | } |
||
47 | |||
48 | 3 | if (empty($oContainer->type) || empty($oContainer->image)) |
|
49 | 3 | { |
|
50 | 2 | return false; |
|
51 | } |
||
52 | |||
53 | 2 | if (!is_array($oContainer->volumes)) |
|
54 | 2 | { |
|
55 | 1 | return false; |
|
56 | } |
||
57 | |||
58 | 2 | foreach ($oContainer->volumes as $_oVolume) |
|
59 | { |
||
60 | 2 | if (!in_array($_oVolume->mode, ['RO', 'RW'])) |
|
61 | 2 | { |
|
62 | 1 | return false; |
|
63 | } |
||
64 | 1 | } |
|
65 | |||
66 | 1 | return true; |
|
67 | } |
||
68 | } |