Code Duplication    Length = 10-10 lines in 2 locations

src/AppBundle/Controller/NooliteController.php 1 location

@@ 28-37 (lines=10) @@
25
        return $this->sendResponse(true, ['request'=>$request->getQueryString()]);
26
    }
27
28
    public function sendResponse($success, array $resp)
29
    {
30
        $response = new Response();
31
        $response->setContent(json_encode(array(
32
            'result' => $success ? 'ok' : 'fail',
33
            'response'=> $resp,
34
        )));
35
        $response->headers->set('Content-Type', 'application/json');
36
        return $response;
37
    }
38
}
39

src/AppBundle/Controller/VariableController.php 1 location

@@ 97-106 (lines=10) @@
94
        );
95
    }
96
97
    public function sendResponse($success, array $resp)
98
    {
99
        $response = new Response();
100
        $response->setContent(json_encode(array(
101
            'result' => $success ? 'ok' : 'fail',
102
            'response'=> $resp,
103
        )));
104
        $response->headers->set('Content-Type', 'application/json');
105
        return $response;
106
    }
107
}
108