Code Duplication    Length = 10-10 lines in 2 locations

Http/Rest/class.DataTableAPI.php 1 location

@@ 196-205 (lines=10) @@
193
            return $response->withStatus(401);
194
        }
195
        $obj = $request->getParsedBody();
196
        if($obj === null)
197
        {
198
            $request->getBody()->rewind();
199
            $obj = $request->getBody()->getContents();
200
            $tmp = json_decode($obj, true);
201
            if($tmp !== null)
202
            {
203
                $obj = $tmp;
204
            }
205
        }
206
        if($this->validateUpdate($obj, $request, $entry) === false)
207
        {
208
            return $response->withStatus(400);

Http/Rest/class.RestAPI.php 1 location

@@ 39-48 (lines=10) @@
36
    protected function getParsedBody($request)
37
    {
38
        $obj = $request->getParsedBody();
39
        if($obj === null)
40
        {
41
            $request->getBody()->rewind();
42
            $obj = $request->getBody()->getContents();
43
            $tmp = json_decode($obj, true);
44
            if($tmp !== null)
45
            {
46
                $obj = $tmp;
47
            }
48
        }
49
        return $obj;
50
    }
51