Code Duplication    Length = 4-4 lines in 3 locations

api/v1/class.ShiftAPI.php 3 locations

@@ 191-194 (lines=4) @@
188
            return $response->withStatus(404);
189
        }
190
        $entity = $entity[0];
191
        if(isset($entity['participant']) && strlen($entity['participant']) > 0)
192
        {
193
            return $response->withStatus(401);
194
        }
195
        $shift = new \VolunteerShift($shiftId, $entity);
196
        $entity = $this->processShift($entity, $request);
197
        if(isset($entity['overlap']) && $entity['overlap'])
@@ 323-326 (lines=4) @@
320
            return $response->withStatus(404);
321
        }
322
        $entity = $entity[0];
323
        if(isset($entity['participant']) && strlen($entity['participant']) > 0)
324
        {
325
            return $response->withStatus(401);
326
        }
327
        $filter = new \Data\Filter('groupID eq '.$entity['groupID'].' and enabled eq true');
328
        $entities = $dataTable->read($filter);
329
        $count = count($entities);
@@ 370-373 (lines=4) @@
367
            return $response->withStatus(404);
368
        }
369
        $entity = $entity[0];
370
        if(isset($entity['participant']) && strlen($entity['participant']) > 0)
371
        {
372
            return $response->withStatus(401);
373
        }
374
        $data = $request->getParsedBody();
375
        $myShift = $data['myshift'];
376
        $roles = array();