ObjectManagerDecorator   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 107
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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
declare(strict_types=1);
4
5
namespace Doctrine\Persistence;
6
7
use Doctrine\Persistence\Mapping\ClassMetadata;
8
use Doctrine\Persistence\Mapping\ClassMetadataFactory;
9
10
/**
11
 * Base class to simplify ObjectManager decorators
12
 */
13
abstract class ObjectManagerDecorator implements ObjectManager
14
{
15
    /** @var ObjectManager */
16
    protected $wrapped;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21 1
    public function find(string $className, $id) : ?object
22
    {
23 1
        return $this->wrapped->find($className, $id);
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 1
    public function persist(object $object) : void
30
    {
31 1
        $this->wrapped->persist($object);
32 1
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 1
    public function remove(object $object) : void
38
    {
39 1
        $this->wrapped->remove($object);
40 1
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45 1
    public function merge(object $object) : object
46
    {
47 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

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

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