Code Duplication    Length = 10-10 lines in 2 locations

api/v1/class.DepartmentAPI.php 1 location

@@ 169-178 (lines=10) @@
166
            return $response->withStatus(404);
167
        }
168
        $obj = $request->getParsedBody();
169
        if($obj === null)
170
        {
171
            $request->getBody()->rewind();
172
            $obj = $request->getBody()->getContents();
173
            $tmp = json_decode($obj, true);
174
            if($tmp !== null)
175
            {
176
                $obj = $tmp;
177
            }
178
        }
179
        $ret = $dataTable->update($filter, $obj);
180
        return $response->withJson($ret);
181
    }

api/v1/class.ParticipantAPI.php 1 location

@@ 239-248 (lines=10) @@
236
            return $response->withStatus(404);
237
        }
238
        $obj = $request->getParsedBody();
239
        if($obj === null)
240
        {
241
            $request->getBody()->rewind();
242
            $obj = $request->getBody()->getContents();
243
            $tmp = json_decode($obj, true);
244
            if($tmp !== null)
245
            {
246
                $obj = $tmp;
247
            }
248
        }
249
        unset($user['certs'][$certType]);
250
        $ret = $dataTable->update($filter, $user);
251
        if($ret)