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

ReflectionProviderFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A create() 0 6 1
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