Completed
Push — master ( 6ffec3...6f905d )
by Oleg
06:32
created

ReflectionProviderFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DFCodeGeneration\Generator\Tests;
5
6
class ReflectionProviderFactory implements EntityProviderFactoryInterface
7
{
8
    /**
9
     * @var IdHandlerInterface
10
     */
11
    private $idHandler;
12
13
    public function __construct(IdHandlerInterface $idHandler)
14
    {
15
        $this->idHandler = $idHandler;
16
    }
17
18
    public function create(string $entityClassName): EntityProviderInterface
19
    {
20
        return new ReflectionProvider(
21
            $entityClassName,
22
            new FakerValueProvider($entityClassName, $this->idHandler),
23
            $this->idHandler
24
        );
25
    }
26
}
27