Passed
Pull Request — 1.3.x (#71)
by Grégoire
02:39
created

ObjectManagerDecorator   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 107
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 13
eloc 15
dl 0
loc 107
rs 10
c 0
b 0
f 0
ccs 33
cts 33
cp 1

13 Methods

Rating   Name   Duplication   Size   Complexity  
A flush() 0 3 1
A persist() 0 3 1
A remove() 0 3 1
A clear() 0 3 1
A contains() 0 3 1
A refresh() 0 3 1
A detach() 0 3 1
A getMetadataFactory() 0 3 1
A getRepository() 0 3 1
A find() 0 3 1
A merge() 0 3 1
A initializeObject() 0 3 1
A getClassMetadata() 0 3 1
1
<?php
2
3
namespace Doctrine\Persistence;
4
5
/**
6
 * Base class to simplify ObjectManager decorators
7
 */
8
abstract class ObjectManagerDecorator implements ObjectManager
9
{
10
    /** @var ObjectManager */
11
    protected $wrapped;
12
13
    /**
14
     * {@inheritdoc}
15
     */
16 1
    public function find($className, $id)
17
    {
18 1
        return $this->wrapped->find($className, $id);
19
    }
20
21
    /**
22
     * {@inheritdoc}
23
     */
24 1
    public function persist($object)
25
    {
26 1
        $this->wrapped->persist($object);
27 1
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 1
    public function remove($object)
33
    {
34 1
        $this->wrapped->remove($object);
35 1
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 1
    public function merge($object)
41
    {
42 1
        return $this->wrapped->merge($object);
0 ignored issues
show
Deprecated Code introduced by
The function Doctrine\Persistence\ObjectManager::merge() has been deprecated: Merge operation is deprecated and will be removed in Persistence 2.0. Merging should be part of the business domain of an application rather than a generic operation of ObjectManager. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

42
        return /** @scrutinizer ignore-deprecated */ $this->wrapped->merge($object);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48 2
    public function clear($objectName = null)
49
    {
50 2
        $this->wrapped->clear($objectName);
51 2
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56 1
    public function detach($object)
57
    {
58 1
        $this->wrapped->detach($object);
0 ignored issues
show
Deprecated Code introduced by
The function Doctrine\Persistence\ObjectManager::detach() has been deprecated: Detach operation is deprecated and will be removed in Persistence 2.0. Please use {@see ObjectManager::clear()} instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

58
        /** @scrutinizer ignore-deprecated */ $this->wrapped->detach($object);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
59 1
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64 1
    public function refresh($object)
65
    {
66 1
        $this->wrapped->refresh($object);
67 1
    }
68
69
    /**
70
     * {@inheritdoc}
71
     */
72 1
    public function flush()
73
    {
74 1
        $this->wrapped->flush();
75 1
    }
76
77
    /**
78
     * {@inheritdoc}
79
     */
80 1
    public function getRepository($className)
81
    {
82 1
        return $this->wrapped->getRepository($className);
83
    }
84
85
    /**
86
     * {@inheritdoc}
87
     */
88 1
    public function getClassMetadata($className)
89
    {
90 1
        return $this->wrapped->getClassMetadata($className);
91
    }
92
93
    /**
94
     * {@inheritdoc}
95
     */
96 1
    public function getMetadataFactory()
97
    {
98 1
        return $this->wrapped->getMetadataFactory();
99
    }
100
101
    /**
102
     * {@inheritdoc}
103
     */
104 1
    public function initializeObject($obj)
105
    {
106 1
        $this->wrapped->initializeObject($obj);
107 1
    }
108
109
    /**
110
     * {@inheritdoc}
111
     */
112 1
    public function contains($object)
113
    {
114 1
        return $this->wrapped->contains($object);
115
    }
116
}
117