| Conditions | 7 |
| Paths | 7 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 7.2269 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 46 | public function getData() |
||
| 47 | { |
||
| 48 | 17 | if (!\is_array($this->data)) { |
|
| 49 | return null; |
||
| 50 | 17 | } |
|
| 51 | |||
| 52 | if (isset($this->data[0]['$reql_type$']) && $this->data[0]['$reql_type$'] === 'GROUPED_DATA') { |
||
| 53 | $groups = []; |
||
| 54 | foreach ($this->data[0]['data'] as $group) { |
||
| 55 | $groups[] = [ |
||
| 56 | 17 | 'group' => $group[0], |
|
| 57 | 'reduction' => $group[1], |
||
| 58 | 17 | ]; |
|
| 59 | } |
||
| 60 | |||
| 61 | return $groups; |
||
| 62 | 17 | } |
|
| 63 | |||
| 64 | return \count($this->data) === 1 && array_key_exists(0, $this->data) ? $this->data[0] : $this->data; |
||
| 65 | } |
||
| 87 |