Passed
Pull Request — 2.1 (#64)
by Vincent
11:26 queued 05:25
created

MapperFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 1
dl 0
loc 8
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A instantiateMapper() 0 3 1
1
<?php
2
3
namespace Bdf\Prime\Mapper;
4
5
use Bdf\Prime\Cache\CacheInterface;
6
use Bdf\Prime\Entity\Hydrator\MapperHydrator;
7
use Bdf\Prime\Entity\Hydrator\MapperHydratorInterface;
8
use Bdf\Prime\Mapper\NameResolver\ResolverInterface;
9
use Bdf\Prime\Mapper\NameResolver\SuffixResolver;
10
use Bdf\Prime\ServiceLocator;
11
use Psr\SimpleCache\CacheInterface as Psr16CacheInterface;
12
13
use function is_subclass_of;
14
use function str_replace;
15
16
/**
17
 * Default mapper factory
18
 * The mapper class will be resolved by the mapper name resolver, and instantiated by calling the constructor
19
 *
20
 * Will be marked as final in 3.0
21
 */
22
/*final*/ class MapperFactory extends AbstractMapperFactory
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27 442
    protected function instantiateMapper(ServiceLocator $locator, string $mapperClass): Mapper
28
    {
29 442
        return new $mapperClass($locator);
30
    }
31
}
32