Code Duplication    Length = 6-11 lines in 3 locations

Core/Executor/ContentManager.php 1 location

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

Core/Executor/ContentTypeManager.php 1 location

@@ 401-411 (lines=11) @@
398
399
        if (is_array($value)) {
400
            $ret = array();
401
            foreach ($value as $key => $val)
402
            {
403
                $ret[$key] = $val;
404
405
                // we do NOT check for refs in field settings which are arrays, even though we could, maybe *should*...
406
                if (!is_array($val)) {
407
                    if ($this->referenceResolver->isReference($val)) {
408
                        $ret[$key] = $this->referenceResolver->getReferenceValue($val);
409
                    }
410
                }
411
            }
412
        }
413
        else {
414
            $ret = $value;

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