Code Duplication    Length = 3-3 lines in 2 locations

Core/Executor/ContentTypeManager.php 1 location

@@ 379-381 (lines=3) @@
376
                        $fieldIdentifier = preg_replace('/[[(|&!{].*$/', '', $parts[1]);
377
                        $fieldDefinition = $contentType->getFieldDefinition($fieldIdentifier);
378
                        $hashValue = $this->fieldDefinitionToHash($contentType, $fieldDefinition, $step->context);
379
                        if (count($parts) == 2 && $fieldIdentifier === $parts[1]) {
380
                            throw new \InvalidArgumentException('Content Type Manager does not support setting references for attribute ' . $reference['attribute'] . ': please specify an attribute definition sub element');
381
                        }
382
                        $value = JmesPath::search(implode('.', array_slice($parts, 1)), array($fieldIdentifier => $hashValue));
383
                        break;
384
                    }

Core/Executor/ContentManager.php 1 location

@@ 460-462 (lines=3) @@
457
                            $fieldDefinition->fieldTypeIdentifier, $contentType->identifier, $field->value
458
                        );
459
                        if (is_array($hashValue) ) {
460
                            if (count($parts) == 2 && $fieldIdentifier === $parts[1]) {
461
                                throw new \InvalidArgumentException('Content Manager does not support setting references for attribute ' . $reference['attribute'] . ': the given attribute has an array value');
462
                            }
463
                            $value = JmesPath::search(implode('.', array_slice($parts, 1)), array($fieldIdentifier => $hashValue));
464
                        } else {
465
                            if (count($parts) > 2) {