Completed
Push — master ( 81ce9d...1672d9 )
by Oleg
03:54
created

ReflectionProviderFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 8
cts 8
cp 1
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 2
    public function __construct(IdHandlerInterface $idHandler)
14
    {
15 2
        $this->idHandler = $idHandler;
16 2
    }
17
18 2
    public function create(string $entityClassName): EntityProviderInterface
19
    {
20 2
        return new ReflectionProvider(
21 2
            $entityClassName,
22 2
            new FakerValueProvider($entityClassName, $this->idHandler),
23 2
            $this->idHandler
24
        );
25
    }
26
}
27