Conditions | 3 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3.4746 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | 2 | public function render(AbstractTable $table) |
|
11 | { |
||
12 | 2 | $jsonVars = []; |
|
13 | 2 | $jsonVars['recordsTotal'] = $table->getUnfilteredCount(); |
|
14 | 2 | $filterCount = $table->getFilteredCount(); |
|
15 | 2 | $jsonVars['recordsFiltered'] = $filterCount!==false ? $filterCount : $jsonVars['recordsTotal']; |
|
16 | 2 | $jsonVars['data'] = array_map( |
|
17 | 2 | function ($item) { |
|
18 | $t = []; |
||
19 | foreach ($item as $k => $v) { |
||
20 | $t[] = $v; |
||
21 | } |
||
22 | |||
23 | return $t; |
||
24 | 2 | }, |
|
25 | 2 | $table->getOutputRows() |
|
26 | 2 | ); |
|
27 | |||
28 | return json_encode($jsonVars); |
||
29 | } |
||
30 | |||
39 |