Code Duplication    Length = 4-5 lines in 2 locations

api/v1/class.ShiftAPI.php 2 locations

@@ 320-323 (lines=4) @@
317
        $roles = array();
318
        for($i = 0; $i < $count; $i++)
319
        {
320
            if(isset($entities[$i]['status']) && ($entities[$i]['status'] === 'filled' || $entities[$i]['status'] === 'pending'))
321
            {
322
                continue;
323
            }
324
            if(!isset($roles[$entities[$i]['roleID']]))
325
            {
326
                $roles[$entities[$i]['roleID']] = new \VolunteerRole($entities[$i]['roleID']);
@@ 367-371 (lines=5) @@
364
        $uuid = $this->genUUID();
365
        for($i = 0; $i < $count; $i++)
366
        {
367
            if(isset($entities[$i]['status']) && ($entities[$i]['status'] === 'filled' || $entities[$i]['status'] === 'pending'))
368
            {
369
                $entities[$i] = false;
370
                continue;
371
            }
372
            if((string)$entities[$i]['_id'] === (string)new \MongoDB\BSON\ObjectId($myShift))
373
            {
374
                $entities[$i]['participant'] = $this->user->uid;