Code Duplication    Length = 3-4 lines in 6 locations

lib/Doctrine/ODM/CouchDB/UnitOfWork.php 6 locations

@@ 257-259 (lines=3) @@
254
            }
255
        }
256
257
        if ($this->evm->hasListeners(Event::postLoad)) {
258
            $this->evm->dispatchEvent(Event::postLoad, new Event\LifecycleEventArgs($document, $this->dm));
259
        }
260
261
        return $document;
262
    }
@@ 395-397 (lines=3) @@
392
        $this->scheduledRemovals[$oid] = $document;
393
        $this->documentState[$oid] = self::STATE_REMOVED;
394
395
        if ($this->evm->hasListeners(Event::preRemove)) {
396
            $this->evm->dispatchEvent(Event::preRemove, new Event\LifecycleEventArgs($document, $this->dm));
397
        }
398
399
        $this->cascadeRemove($document, $visited);
400
    }
@@ 985-987 (lines=3) @@
982
983
        $this->registerManaged($document, $id, null);
984
985
        if ($this->evm->hasListeners(Event::prePersist)) {
986
            $this->evm->dispatchEvent(Event::prePersist, new Event\LifecycleEventArgs($document, $this->dm));
987
        }
988
    }
989
990
    /**
@@ 1028-1030 (lines=3) @@
1025
            $bulkUpdater->deleteDocument($this->documentIdentifiers[$oid], $this->documentRevisions[$oid]);
1026
            $this->removeFromIdentityMap($document);
1027
1028
            if ($this->evm->hasListeners(Event::postRemove)) {
1029
                $this->evm->dispatchEvent(Event::postRemove, new Event\LifecycleEventArgs($document, $this->dm));
1030
            }
1031
        }
1032
1033
        foreach ($this->scheduledUpdates AS $oid => $document) {
@@ 1036-1039 (lines=4) @@
1033
        foreach ($this->scheduledUpdates AS $oid => $document) {
1034
            $class = $this->dm->getClassMetadata(get_class($document));
1035
1036
            if ($this->evm->hasListeners(Event::preUpdate)) {
1037
                $this->evm->dispatchEvent(Event::preUpdate, new Event\LifecycleEventArgs($document, $this->dm));
1038
                $this->computeChangeSet($class, $document); // TODO: prevent association computations in this case?
1039
            }
1040
1041
            $data = $this->metadataResolver->createDefaultDocumentStruct($class);
1042
@@ 1127-1129 (lines=3) @@
1124
                    }
1125
                }
1126
1127
                if ($this->evm->hasListeners(Event::postUpdate)) {
1128
                    $this->evm->dispatchEvent(Event::postUpdate, new Event\LifecycleEventArgs($document, $this->dm));
1129
                }
1130
            }
1131
        } else if ($response->status >= 400) {
1132
            throw HTTPException::fromResponse($bulkUpdater->getPath(), $response);