createRDMMappingDriver()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

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