Passed
Push — master ( d61c1e...6d0b22 )
by Théo
02:15
created

EnrichedReflectorFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 11 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Humbug\PhpScoper\Symbol;
6
7
use Humbug\PhpScoper\Configuration\SymbolsConfiguration;
8
9
final class EnrichedReflectorFactory
10
{
11
    private Reflector $reflector;
12
13
    public function __construct(Reflector $reflector)
14
    {
15
        $this->reflector = $reflector;
16
    }
17
18
    public function create(SymbolsConfiguration $symbolsConfiguration): EnrichedReflector
19
    {
20
        $configuredReflector = $this->reflector->withSymbols(
21
            $symbolsConfiguration->getExcludedClassNames(),
22
            $symbolsConfiguration->getExcludedFunctionNames(),
23
            $symbolsConfiguration->getExcludedConstantNames(),
24
        );
25
26
        return new EnrichedReflector(
27
            $configuredReflector,
28
            $symbolsConfiguration,
29
        );
30
    }
31
}
32