GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#18)
by
unknown
02:20
created

JsonRenderer::renderJsonResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1.0156

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
ccs 3
cts 4
cp 0.75
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 1.0156
1
<?php
2
3
namespace CrossKnowledge\DataTableBundle\DataTable\Renderer;
4
5
use CrossKnowledge\DataTableBundle\DataTable\Table\AbstractTable;
6
use Symfony\Component\HttpFoundation\JsonResponse;
7
8
class JsonRenderer implements RendererInterface
9
{
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
31 1
    public function renderJsonResponse(AbstractTable $table)
32
    {
33 1
        $response = new JsonResponse();
34 1
        $response->setContent($this->render($table));
35
36
        return $response;
37
    }
38
}
39