Passed
Push — types ( 30d5cd )
by Jonathan
04:47
created

ObjectManagerDecorator::contains()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Doctrine\Persistence;
4
5
use Doctrine\Persistence\Mapping\ClassMetadata;
6
use Doctrine\Persistence\Mapping\ClassMetadataFactory;
7
8
/**
9
 * Base class to simplify ObjectManager decorators
10
 */
11
abstract class ObjectManagerDecorator implements ObjectManager
12
{
13
    /** @var ObjectManager */
14
    protected $wrapped;
15
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function find(string $className, $id) : object
20
    {
21
        return $this->wrapped->find($className, $id);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->wrapped->find($className, $id) could return the type null which is incompatible with the type-hinted return object. Consider adding an additional type-check to rule them out.
Loading history...
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function persist(object $object) : void
28
    {
29
        $this->wrapped->persist($object);
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function remove(object $object) : void
36
    {
37
        $this->wrapped->remove($object);
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function merge(object $object) : object
44
    {
45
        return $this->wrapped->merge($object);
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function clear(?string $objectName = null) : void
52
    {
53
        $this->wrapped->clear($objectName);
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function detach(object $object) : void
60
    {
61
        $this->wrapped->detach($object);
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67
    public function refresh(object $object) : void
68
    {
69
        $this->wrapped->refresh($object);
70
    }
71
72
    /**
73
     * {@inheritdoc}
74
     */
75
    public function flush() : void
76
    {
77
        $this->wrapped->flush();
78
    }
79
80
    /**
81
     * {@inheritdoc}
82
     */
83
    public function getRepository(string $className) : ObjectRepository
84
    {
85
        return $this->wrapped->getRepository($className);
86
    }
87
88
    /**
89
     * {@inheritdoc}
90
     */
91
    public function getClassMetadata(string $className) : ClassMetadata
92
    {
93
        return $this->wrapped->getClassMetadata($className);
94
    }
95
96
    /**
97
     * {@inheritdoc}
98
     */
99
    public function getMetadataFactory() : ClassMetadataFactory
100
    {
101
        return $this->wrapped->getMetadataFactory();
102
    }
103
104
    /**
105
     * {@inheritdoc}
106
     */
107
    public function initializeObject(object $obj) : void
108
    {
109
        $this->wrapped->initializeObject($obj);
110
    }
111
112
    /**
113
     * {@inheritdoc}
114
     */
115
    public function contains(object $object) : bool
116
    {
117
        return $this->wrapped->contains($object);
118
    }
119
}
120