ProvidesObjectManager   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 21
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setObjectManager() 0 4 1
A getObjectManager() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineModule\Persistence;
6
7
use Doctrine\Persistence\ObjectManager;
8
use function interface_exists;
9
10
/**
11
 * Trait to provide object manager to a form (only works from PHP 5.4)
12
 */
13
trait ProvidesObjectManager
14
{
15
    /** @var ObjectManager */
16
    protected $objectManager;
17
18
    /**
19
     * Set the object manager
20
     */
21
    public function setObjectManager(ObjectManager $objectManager) : void
22
    {
23
        $this->objectManager = $objectManager;
24
    }
25
26
    /**
27
     * Get the object manager
28
     */
29
    public function getObjectManager() : ObjectManager
30
    {
31
        return $this->objectManager;
32
    }
33
}
34
35
interface_exists(ObjectManager::class);
36