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

MapperFactory::setMetadataCache()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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