Code Duplication    Length = 4-5 lines in 2 locations

api/v1/class.ShiftAPI.php 2 locations

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