Code Duplication    Length = 4-5 lines in 2 locations

api/v1/class.ShiftAPI.php 2 locations

@@ 417-420 (lines=4) @@
414
        $roles = array();
415
        for($i = 0; $i < $count; $i++)
416
        {
417
            if(isset($entities[$i]['status']) && ($entities[$i]['status'] === 'filled' || $entities[$i]['status'] === 'pending'))
418
            {
419
                continue;
420
            }
421
            if(!isset($roles[$entities[$i]['roleID']]))
422
            {
423
                $roles[$entities[$i]['roleID']] = new \VolunteerRole($entities[$i]['roleID']);
@@ 464-468 (lines=5) @@
461
        $uuid = $this->genUUID();
462
        for($i = 0; $i < $count; $i++)
463
        {
464
            if(isset($entities[$i]['status']) && ($entities[$i]['status'] === 'filled' || $entities[$i]['status'] === 'pending'))
465
            {
466
                $entities[$i] = false;
467
                continue;
468
            }
469
            if((string)$entities[$i]['_id'] === (string)new \MongoDB\BSON\ObjectId($myShift))
470
            {
471
                $entities[$i]['participant'] = $this->user->uid;