Failed Conditions
Push — types ( 30d5cd...98b391 )
by Jonathan
02:28
created

ObjectManagerDecorator::merge()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 1
crap 1
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 1
    public function find(string $className, $id) : object
20
    {
21 1
        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 1
    public function persist(object $object) : void
28
    {
29 1
        $this->wrapped->persist($object);
30 1
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 1
    public function remove(object $object) : void
36
    {
37 1
        $this->wrapped->remove($object);
38 1
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43 1
    public function merge(object $object) : object
44
    {
45 1
        return $this->wrapped->merge($object);
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51 2
    public function clear(?string $objectName = null) : void
52
    {
53 2
        $this->wrapped->clear($objectName);
54 2
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59 1
    public function detach(object $object) : void
60
    {
61 1
        $this->wrapped->detach($object);
62 1
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67 1
    public function refresh(object $object) : void
68
    {
69 1
        $this->wrapped->refresh($object);
70 1
    }
71
72
    /**
73
     * {@inheritdoc}
74
     */
75 1
    public function flush() : void
76
    {
77 1
        $this->wrapped->flush();
78 1
    }
79
80
    /**
81
     * {@inheritdoc}
82
     */
83 1
    public function getRepository(string $className) : ObjectRepository
84
    {
85 1
        return $this->wrapped->getRepository($className);
86
    }
87
88
    /**
89
     * {@inheritdoc}
90
     */
91 1
    public function getClassMetadata(string $className) : ClassMetadata
92
    {
93 1
        return $this->wrapped->getClassMetadata($className);
94
    }
95
96
    /**
97
     * {@inheritdoc}
98
     */
99 1
    public function getMetadataFactory() : ClassMetadataFactory
100
    {
101 1
        return $this->wrapped->getMetadataFactory();
102
    }
103
104
    /**
105
     * {@inheritdoc}
106
     */
107 1
    public function initializeObject(object $obj) : void
108
    {
109 1
        $this->wrapped->initializeObject($obj);
110 1
    }
111
112
    /**
113
     * {@inheritdoc}
114
     */
115 1
    public function contains(object $object) : bool
116
    {
117 1
        return $this->wrapped->contains($object);
118
    }
119
}
120