Code Duplication    Length = 6-11 lines in 3 locations

Core/Executor/RoleManager.php 1 location

@@ 178-183 (lines=6) @@
175
176
        $limitationValue = is_array($limitation['values']) ? $limitation['values'] : array($limitation['values']);
177
178
        foreach($limitationValue as $id => $value) {
179
            if ($this->referenceResolver->isReference($value)) {
180
                $value = $this->referenceResolver->getReferenceValue($value);
181
                $limitationValue[$id] = $value;
182
            }
183
        }
184
185
        $limitationValue = $this->roleHandler->convertLimitationToValue($limitation['identifier'], $limitationValue);
186

Core/Executor/ContentManager.php 1 location

@@ 110-117 (lines=8) @@
107
        $locations = array($locationCreateStruct);
108
109
        if (array_key_exists('other_locations', $this->dsl)) {
110
            foreach ($this->dsl['other_locations'] as $otherLocation) {
111
                $locationId = $otherLocation;
112
                if ($this->referenceResolver->isReference($locationId)) {
113
                    $locationId = $this->referenceResolver->getReferenceValue($otherLocation);
114
                }
115
                $secondaryLocationCreateStruct = $locationService->newLocationCreateStruct($locationId);
116
                array_push($locations, $secondaryLocationCreateStruct);
117
            }
118
        }
119
120
        // create a draft using the content and location create struct and publish it

Core/Executor/ContentTypeManager.php 1 location

@@ 411-421 (lines=11) @@
408
409
        if (is_array($value)) {
410
            $ret = array();
411
            foreach ($value as $key => $val)
412
            {
413
                $ret[$key] = $val;
414
415
                // we do NOT check for refs in field settings which are arrays, even though we could, maybe *should*...
416
                if (!is_array($val)) {
417
                    if ($this->referenceResolver->isReference($val)) {
418
                        $ret[$key] = $this->referenceResolver->getReferenceValue($val);
419
                    }
420
                }
421
            }
422
        }
423
        else {
424
            $ret = $value;