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/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

src/Denormalizer/Relation/ReferenceManyFieldDenormalizer.php 1 location

@@ 83-89 (lines=7) @@
80
81
            $referencedObject = $repository($subValue);
82
83
            if (null !== $referencedObject) {
84
                if (interface_exists('Doctrine\Common\Persistence\Proxy')
85
                    && $referencedObject instanceof Proxy && !$referencedObject->__isInitialized()
86
                ) {
87
                    $referencedObject->__load();
88
                }
89
            }
90
91
            $referencedObjects[$i] = $referencedObject;
92
        }