Code Duplication    Length = 4-5 lines in 2 locations

api/v1/class.ShiftAPI.php 2 locations

@@ 357-360 (lines=4) @@
354
        $roles = array();
355
        for($i = 0; $i < $count; $i++)
356
        {
357
            if(isset($entities[$i]['status']) && ($entities[$i]['status'] === 'filled' || $entities[$i]['status'] === 'pending'))
358
            {
359
                continue;
360
            }
361
            if(!isset($roles[$entities[$i]['roleID']]))
362
            {
363
                $roles[$entities[$i]['roleID']] = new \VolunteerRole($entities[$i]['roleID']);
@@ 404-408 (lines=5) @@
401
        $uuid = $this->genUUID();
402
        for($i = 0; $i < $count; $i++)
403
        {
404
            if(isset($entities[$i]['status']) && ($entities[$i]['status'] === 'filled' || $entities[$i]['status'] === 'pending'))
405
            {
406
                $entities[$i] = false;
407
                continue;
408
            }
409
            if((string)$entities[$i]['_id'] === (string)new \MongoDB\BSON\ObjectId($myShift))
410
            {
411
                $entities[$i]['participant'] = $this->user->uid;