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