Failed Conditions
Pull Request — master (#1)
by Jonathan
13:22 queued 10:46
created

LifecycleEventArgs   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 54
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getObjectManager() 0 3 1
A __construct() 0 4 1
A getObject() 0 3 1
A getEntity() 0 3 1
1
<?php
2
namespace Doctrine\Common\Persistence\Event;
3
4
use Doctrine\Common\EventArgs;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\EventArgs was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
use Doctrine\Common\Persistence\ObjectManager;
6
7
/**
8
 * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions
9
 * of entities.
10
 *
11
 * @link   www.doctrine-project.org
12
 * @since  2.2
13
 * @author Roman Borschel <[email protected]>
14
 * @author Benjamin Eberlei <[email protected]>
15
 */
16
class LifecycleEventArgs extends EventArgs
17
{
18
    /**
19
     * @var ObjectManager
20
     */
21
    private $objectManager;
22
23
    /**
24
     * @var object
25
     */
26
    private $object;
27
28
    /**
29
     * Constructor.
30
     *
31
     * @param object        $object
32
     * @param ObjectManager $objectManager
33
     */
34
    public function __construct($object, ObjectManager $objectManager)
35
    {
36
        $this->object        = $object;
37
        $this->objectManager = $objectManager;
38
    }
39
40
    /**
41
     * Retrieves the associated entity.
42
     *
43
     * @deprecated
44
     *
45
     * @return object
46
     */
47
    public function getEntity()
48
    {
49
        return $this->object;
50
    }
51
52
    /**
53
     * Retrieves the associated object.
54
     *
55
     * @return object
56
     */
57
    public function getObject()
58
    {
59
        return $this->object;
60
    }
61
62
    /**
63
     * Retrieves the associated ObjectManager.
64
     *
65
     * @return ObjectManager
66
     */
67
    public function getObjectManager()
68
    {
69
        return $this->objectManager;
70
    }
71
}
72