Code Duplication    Length = 4-5 lines in 2 locations

api/v1/class.ShiftAPI.php 2 locations

@@ 377-380 (lines=4) @@
374
        $roles = array();
375
        for($i = 0; $i < $count; $i++)
376
        {
377
            if(isset($entities[$i]['status']) && ($entities[$i]['status'] === 'filled' || $entities[$i]['status'] === 'pending'))
378
            {
379
                continue;
380
            }
381
            if(!isset($roles[$entities[$i]['roleID']]))
382
            {
383
                $roles[$entities[$i]['roleID']] = new \VolunteerRole($entities[$i]['roleID']);
@@ 424-428 (lines=5) @@
421
        $uuid = $this->genUUID();
422
        for($i = 0; $i < $count; $i++)
423
        {
424
            if(isset($entities[$i]['status']) && ($entities[$i]['status'] === 'filled' || $entities[$i]['status'] === 'pending'))
425
            {
426
                $entities[$i] = false;
427
                continue;
428
            }
429
            if((string)$entities[$i]['_id'] === (string)new \MongoDB\BSON\ObjectId($myShift))
430
            {
431
                $entities[$i]['participant'] = $this->user->uid;