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

EnrichedReflectorFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 11
rs 10
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