Code Duplication    Length = 3-4 lines in 6 locations

lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php 1 location

@@ 183-186 (lines=4) @@
180
181
        $class->setParentClasses($nonSuperclassParents);
182
183
        if ($this->evm->hasListeners(Events::loadClassMetadata)) {
184
            $eventArgs = new \Doctrine\ODM\MongoDB\Event\LoadClassMetadataEventArgs($class, $this->dm);
185
            $this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
186
        }
187
    }
188
189
    /**

lib/Doctrine/ODM/MongoDB/Hydrator/HydratorFactory.php 2 locations

@@ 436-438 (lines=3) @@
433
            $args = array(new PreLoadEventArgs($document, $this->dm, $data));
434
            $metadata->invokeLifecycleCallbacks(Events::preLoad, $document, $args);
435
        }
436
        if ($this->evm->hasListeners(Events::preLoad)) {
437
            $this->evm->dispatchEvent(Events::preLoad, new PreLoadEventArgs($document, $this->dm, $data));
438
        }
439
440
        // alsoLoadMethods may transform the document before hydration
441
        if ( ! empty($metadata->alsoLoadMethods)) {
@@ 462-464 (lines=3) @@
459
        if ( ! empty($metadata->lifecycleCallbacks[Events::postLoad])) {
460
            $metadata->invokeLifecycleCallbacks(Events::postLoad, $document, array(new LifecycleEventArgs($document, $this->dm)));
461
        }
462
        if ($this->evm->hasListeners(Events::postLoad)) {
463
            $this->evm->dispatchEvent(Events::postLoad, new LifecycleEventArgs($document, $this->dm));
464
        }
465
466
        return $data;
467
    }

lib/Doctrine/ODM/MongoDB/UnitOfWork.php 3 locations

@@ 1065-1067 (lines=3) @@
1062
        if ( ! empty($class->lifecycleCallbacks[Events::prePersist])) {
1063
            $class->invokeLifecycleCallbacks(Events::prePersist, $document, array(new LifecycleEventArgs($document, $this->dm)));
1064
        }
1065
        if ($this->evm->hasListeners(Events::prePersist)) {
1066
            $this->evm->dispatchEvent(Events::prePersist, new LifecycleEventArgs($document, $this->dm));
1067
        }
1068
1069
        $upsert = false;
1070
        if ($class->identifier) {
@@ 1964-1966 (lines=3) @@
1961
                if ( ! empty($class->lifecycleCallbacks[Events::preRemove])) {
1962
                    $class->invokeLifecycleCallbacks(Events::preRemove, $document, array(new LifecycleEventArgs($document, $this->dm)));
1963
                }
1964
                if ($this->evm->hasListeners(Events::preRemove)) {
1965
                    $this->evm->dispatchEvent(Events::preRemove, new LifecycleEventArgs($document, $this->dm));
1966
                }
1967
                $this->scheduleForDelete($document);
1968
                break;
1969
            case self::STATE_DETACHED:
@@ 2534-2536 (lines=3) @@
2531
            }
2532
        }
2533
2534
        if ($this->evm->hasListeners(Events::onClear)) {
2535
            $this->evm->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this->dm, $documentName));
2536
        }
2537
    }
2538
2539
    /**