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

@@ 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
        {