Completed
Push — master ( b90edc...95608f )
by Andreas
14:15 queued 11s
created

LifecycleEventArgs   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 15
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDocument() 0 4 1
A getDocumentManager() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ODM\MongoDB\Event;
6
7
use Doctrine\Common\Persistence\Event\LifecycleEventArgs as BaseLifecycleEventArgs;
8
use Doctrine\ODM\MongoDB\DocumentManager;
9
use function assert;
10
11
/**
12
 * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions
13
 * of documents.
14
 */
15
class LifecycleEventArgs extends BaseLifecycleEventArgs
16
{
17
    public function getDocument() : object
18
    {
19
        return $this->getObject();
20
    }
21
22
    public function getDocumentManager() : DocumentManager
23
    {
24
        $dm = $this->getObjectManager();
25
        assert($dm instanceof DocumentManager);
26
27
        return $dm;
28
    }
29
}
30