Failed Conditions
Pull Request — 1.3.x (#71)
by Grégoire
02:28
created

ObjectManagerDecorator::flush()   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 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Doctrine\Persistence;
4
5
use function class_exists;
6
7
/**
8
 * Base class to simplify ObjectManager decorators
9
 */
10
abstract class ObjectManagerDecorator implements ObjectManager
11
{
12
    /** @var ObjectManager */
13
    protected $wrapped;
14
15
    /**
16
     * {@inheritdoc}
17
     */
18 1
    public function find($className, $id)
19
    {
20 1
        return $this->wrapped->find($className, $id);
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 1
    public function persist($object)
27
    {
28 1
        $this->wrapped->persist($object);
29 1
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 1
    public function remove($object)
35
    {
36 1
        $this->wrapped->remove($object);
37 1
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42 1
    public function merge($object)
43
    {
44 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

44
        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...
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50 2
    public function clear($objectName = null)
51
    {
52 2
        $this->wrapped->clear($objectName);
53 2
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58 1
    public function detach($object)
59
    {
60 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

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