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

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