Code Duplication    Length = 3-4 lines in 4 locations

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

@@ 422-424 (lines=3) @@
419
            $args = array(new PreLoadEventArgs($document, $this->dm, $data));
420
            $metadata->invokeLifecycleCallbacks(Events::preLoad, $document, $args);
421
        }
422
        if ($this->evm->hasListeners(Events::preLoad)) {
423
            $this->evm->dispatchEvent(Events::preLoad, new PreLoadEventArgs($document, $this->dm, $data));
424
        }
425
426
        // alsoLoadMethods may transform the document before hydration
427
        if ( ! empty($metadata->alsoLoadMethods)) {
@@ 457-459 (lines=3) @@
454
        if ( ! empty($metadata->lifecycleCallbacks[Events::postLoad])) {
455
            $metadata->invokeLifecycleCallbacks(Events::postLoad, $document, array(new LifecycleEventArgs($document, $this->dm)));
456
        }
457
        if ($this->evm->hasListeners(Events::postLoad)) {
458
            $this->evm->dispatchEvent(Events::postLoad, new LifecycleEventArgs($document, $this->dm));
459
        }
460
461
        return $data;
462
    }

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

@@ 170-173 (lines=4) @@
167
168
        $class->setParentClasses($nonSuperclassParents);
169
170
        if ($this->evm->hasListeners(Events::loadClassMetadata)) {
171
            $eventArgs = new LoadClassMetadataEventArgs($class, $this->dm);
172
            $this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
173
        }
174
    }
175
176
    /**

lib/Doctrine/ODM/MongoDB/UnitOfWork.php 1 location

@@ 2306-2308 (lines=3) @@
2303
            }
2304
        }
2305
2306
        if ($this->evm->hasListeners(Events::onClear)) {
2307
            $this->evm->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this->dm, $documentName));
2308
        }
2309
    }
2310
2311
    /**