Failed Conditions
Push — master ( ddb3cd...4476ec )
by Marco
11:47
created

DisconnectedClassMetadataFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getReflectionService() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ORM\Tools;
6
7
use Doctrine\ORM\Mapping\ClassMetadataFactory;
8
use Doctrine\ORM\Reflection\ReflectionService;
9
use Doctrine\ORM\Reflection\StaticReflectionService;
10
11
/**
12
 * The DisconnectedClassMetadataFactory is used to create ClassMetadata objects
13
 * that do not require the entity class actually exist. This allows us to
14
 * load some mapping information and use it to do things like generate code
15
 * from the mapping information.
16
 */
17
class DisconnectedClassMetadataFactory extends ClassMetadataFactory
18
{
19
    public function getReflectionService() : ReflectionService
20
    {
21
        if ($this->reflectionService === null) {
22
            $this->reflectionService = new StaticReflectionService();
23
        }
24
25
        return $this->reflectionService;
26
    }
27
}
28