MappingStaticPHPDriverFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A createRDMMappingDriver() 0 11 2
1
<?php
2
/**
3
 * Copyright (C) 2018 Gerrit Addiks.
4
 * This package (including this file) was released under the terms of the GPL-3.0.
5
 * You should have received a copy of the GNU General Public License along with this program.
6
 * If not, see <http://www.gnu.org/licenses/> or send me a mail so i can send you a copy.
7
 * @license GPL-3.0
8
 * @author Gerrit Addiks <[email protected]>
9
 */
10
11
namespace Addiks\RDMBundle\Mapping\DriverFactories;
12
13
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
14
use Doctrine\Persistence\Mapping\Driver\StaticPHPDriver;
15
use Addiks\RDMBundle\Mapping\DriverFactories\MappingDriverFactoryInterface;
16
use Addiks\RDMBundle\Mapping\Drivers\MappingStaticPHPDriver;
17
use Addiks\RDMBundle\Mapping\Drivers\MappingDriverInterface;
18
19
final class MappingStaticPHPDriverFactory implements MappingDriverFactoryInterface
20
{
21
22 1
    public function createRDMMappingDriver(
23
        MappingDriver $mappingDriver
24
    ): ?MappingDriverInterface {
25
        /** @var ?MappingDriverInterface $rdmMetadataDriver */
26 1
        $rdmMetadataDriver = null;
27
28 1
        if ($mappingDriver instanceof StaticPHPDriver) {
29 1
            $rdmMetadataDriver = new MappingStaticPHPDriver();
30
        }
31
32 1
        return $rdmMetadataDriver;
33
    }
34
35
}
36