Code Duplication    Length = 3-3 lines in 2 locations

Core/Executor/ContentManager.php 1 location

@@ 452-454 (lines=3) @@
449
                            $fieldDefinition->fieldTypeIdentifier, $contentType->identifier, $field->value
450
                        );
451
                        if (is_array($hashValue)) {
452
                            if (count($parts) == 2 && $fieldIdentifier === $parts[1]) {
453
                                throw new \InvalidArgumentException('Content Manager does not support setting references for attribute ' . $reference['attribute'] . ': the given attribute has an array value');
454
                            }
455
                            $value = JmesPath::search(implode('.', array_slice($parts, 1)), array($fieldIdentifier => $hashValue));
456
                        } else {
457
                            if (count($parts) > 2) {

Core/Executor/ContentTypeManager.php 1 location

@@ 423-425 (lines=3) @@
420
                        $fieldIdentifier = preg_replace('/[[(|&!{].*$/', '', $parts[1]);
421
                        $fieldDefinition = $contentType->getFieldDefinition($fieldIdentifier);
422
                        $hashValue = $this->fieldDefinitionToHash($contentType, $fieldDefinition, $step->context);
423
                        if (count($parts) == 2 && $fieldIdentifier === $parts[1]) {
424
                            throw new \InvalidArgumentException('Content Type Manager does not support setting references for attribute ' . $reference['attribute'] . ': please specify an attribute definition sub element');
425
                        }
426
                        $value = JmesPath::search(implode('.', array_slice($parts, 1)), array($fieldIdentifier => $hashValue));
427
                        break;
428
                    }