Code Duplication    Length = 3-3 lines in 2 locations

Core/Executor/ContentTypeManager.php 1 location

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

Core/Executor/ContentManager.php 1 location

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