Code Duplication    Length = 10-10 lines in 2 locations

api/v1/class.ParticipantAPI.php 1 location

@@ 240-249 (lines=10) @@
237
            return $response->withStatus(404);
238
        }
239
        $obj = $request->getParsedBody();
240
        if($obj === null)
241
        {
242
            $request->getBody()->rewind();
243
            $obj = $request->getBody()->getContents();
244
            $tmp = json_decode($obj, true);
245
            if($tmp !== null)
246
            {
247
                $obj = $tmp;
248
            }
249
        }
250
        $reason = 'Unknown';
251
        switch($obj['reason'])
252
        {

api/v1/class.DepartmentAPI.php 1 location

@@ 179-188 (lines=10) @@
176
            return $response->withStatus(404);
177
        }
178
        $obj = $request->getParsedBody();
179
        if($obj === null)
180
        {
181
            $request->getBody()->rewind();
182
            $obj = $request->getBody()->getContents();
183
            $tmp = json_decode($obj, true);
184
            if($tmp !== null)
185
            {
186
                $obj = $tmp;
187
            }
188
        }
189
        $ret = $dataTable->update($filter, $obj);
190
        return $response->withJson($ret);
191
    }