ProvidesObjectManager::setObjectManager()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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