Code Duplication    Length = 6-11 lines in 3 locations

Core/Executor/ContentTypeManager.php 1 location

@@ 460-470 (lines=11) @@
457
458
        if (is_array($value)) {
459
            $ret = array();
460
            foreach ($value as $key => $val)
461
            {
462
                $ret[$key] = $val;
463
464
                // we do NOT check for refs in field settings which are arrays, even though we could, maybe *should*...
465
                if (!is_array($val)) {
466
                    if ($this->referenceResolver->isReference($val)) {
467
                        $ret[$key] = $this->referenceResolver->getReferenceValue($val);
468
                    }
469
                }
470
            }
471
        }
472
        else {
473
            $ret = $value;

Core/Executor/RoleManager.php 1 location

@@ 231-236 (lines=6) @@
228
229
        $limitationValue = is_array($limitation['values']) ? $limitation['values'] : array($limitation['values']);
230
231
        foreach($limitationValue as $id => $value) {
232
            if ($this->referenceResolver->isReference($value)) {
233
                $value = $this->referenceResolver->getReferenceValue($value);
234
                $limitationValue[$id] = $value;
235
            }
236
        }
237
        $limitationValue = $this->roleHandler->convertLimitationToValue($limitation['identifier'], $limitationValue);
238
        return $limitationType->buildValue($limitationValue);
239
    }

Core/Executor/ContentManager.php 1 location

@@ 95-102 (lines=8) @@
92
        $locations = array($locationCreateStruct);
93
94
        if (array_key_exists('other_locations', $this->dsl)) {
95
            foreach ($this->dsl['other_locations'] as $otherLocation) {
96
                $locationId = $otherLocation;
97
                if ($this->referenceResolver->isReference($locationId)) {
98
                    $locationId = $this->referenceResolver->getReferenceValue($otherLocation);
99
                }
100
                $secondaryLocationCreateStruct = $locationService->newLocationCreateStruct($locationId);
101
                array_push($locations, $secondaryLocationCreateStruct);
102
            }
103
        }
104
105
        // create a draft using the content and location create struct and publish it