Code Duplication    Length = 4-5 lines in 2 locations

api/v1/class.ShiftAPI.php 2 locations

@@ 348-351 (lines=4) @@
345
        $roles = array();
346
        for($i = 0; $i < $count; $i++)
347
        {
348
            if(isset($entities[$i]['status']) && ($entities[$i]['status'] === 'filled' || $entities[$i]['status'] === 'pending'))
349
            {
350
                continue;
351
            }
352
            if(!isset($roles[$entities[$i]['roleID']]))
353
            {
354
                $roles[$entities[$i]['roleID']] = new \VolunteerRole($entities[$i]['roleID']);
@@ 395-399 (lines=5) @@
392
        $uuid = $this->genUUID();
393
        for($i = 0; $i < $count; $i++)
394
        {
395
            if(isset($entities[$i]['status']) && ($entities[$i]['status'] === 'filled' || $entities[$i]['status'] === 'pending'))
396
            {
397
                $entities[$i] = false;
398
                continue;
399
            }
400
            if((string)$entities[$i]['_id'] === (string)new \MongoDB\BSON\ObjectId($myShift))
401
            {
402
                $entities[$i]['participant'] = $this->user->uid;