Code Duplication    Length = 3-3 lines in 2 locations

Core/Executor/ContentManager.php 1 location

@@ 443-445 (lines=3) @@
440
                            $fieldDefinition->fieldTypeIdentifier, $contentType->identifier, $field->value
441
                        );
442
                        if (is_array($hashValue) ) {
443
                            if (count($parts) == 2 && $fieldIdentifier === $parts[1]) {
444
                                throw new \InvalidArgumentException('Content Manager does not support setting references for attribute ' . $reference['attribute'] . ': the given attribute has an array value');
445
                            }
446
                            $value = JmesPath::search(implode('.', array_slice($parts, 1)), array($fieldIdentifier => $hashValue));
447
                        } else {
448
                            if (count($parts) > 2) {

Core/Executor/ContentTypeManager.php 1 location

@@ 351-353 (lines=3) @@
348
                        $fieldIdentifier = preg_replace('/[[(|&!{].*$/', '', $parts[1]);
349
                        $fieldDefinition = $contentType->getFieldDefinition($fieldIdentifier);
350
                        $hashValue = $this->fieldDefinitionToHash($contentType, $fieldDefinition, $step->context);
351
                        if (count($parts) == 2 && $fieldIdentifier === $parts[1]) {
352
                            throw new \InvalidArgumentException('Content Type Manager does not support setting references for attribute ' . $reference['attribute'] . ': please specify an attribute definition sub element');
353
                        }
354
                        $value = JmesPath::search(implode('.', array_slice($parts, 1)), array($fieldIdentifier => $hashValue));
355
                        break;
356
                    }