Code Duplication    Length = 7-9 lines in 3 locations

src/Denormalizer/Relation/EmbedOneFieldDenormalizer.php 1 location

@@ 66-74 (lines=9) @@
63
64
        if (is_array($value)) {
65
            $embeddedObject = $this->accessor->getValue($object);
66
            if (null !== $embeddedObject) {
67
                if (interface_exists('Doctrine\Common\Persistence\Proxy')
68
                    && $embeddedObject instanceof Proxy && !$embeddedObject->__isInitialized()
69
                ) {
70
                    $embeddedObject->__load();
71
                }
72
            } else {
73
                $embeddedObject = $this->class;
74
            }
75
76
            $this->accessor->setValue($object, $denormalizer->denormalize($embeddedObject, $value, $context, $path));
77

src/Denormalizer/Relation/ReferenceManyFieldDenormalizer.php 1 location

@@ 76-82 (lines=7) @@
73
74
            $referencedObject = $repository($subValue);
75
76
            if (null !== $referencedObject) {
77
                if (interface_exists('Doctrine\Common\Persistence\Proxy')
78
                    && $referencedObject instanceof Proxy && !$referencedObject->__isInitialized()
79
                ) {
80
                    $referencedObject->__load();
81
                }
82
            }
83
84
            $referencedObjects[$i] = $referencedObject;
85
        }

src/Denormalizer/Relation/ReferenceOneFieldDenormalizer.php 1 location

@@ 63-69 (lines=7) @@
60
61
            $referencedObject = $repository($value);
62
63
            if (null !== $referencedObject) {
64
                if (interface_exists('Doctrine\Common\Persistence\Proxy')
65
                    && $referencedObject instanceof Proxy && !$referencedObject->__isInitialized()
66
                ) {
67
                    $referencedObject->__load();
68
                }
69
            }
70
71
            $this->accessor->setValue($object, $referencedObject);
72