| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 2 | public function getValue($path, $context = ConfigurationRepository::CONTEXT_DEFAULT) |
|
| 28 | { |
||
| 29 | 2 | $document = $this->mongo->findOne([ |
|
| 30 | 2 | 'context' => $context |
|
| 31 | ]); |
||
| 32 | 2 | $paths = explode('/', $path); |
|
| 33 | 2 | if ($document === null) { |
|
| 34 | 1 | $document = []; |
|
| 35 | } |
||
| 36 | 2 | if (isset($document[$paths[0]][$paths[1]][$paths[2]])) { |
|
| 37 | 1 | return $document[$paths[0]][$paths[1]][$paths[2]]; |
|
| 38 | } |
||
| 39 | 1 | return null; |
|
| 40 | } |
||
| 41 | |||
| 66 |