EnrichedReflectorFactory::create()   A
last analyzed

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
/*
6
 * This file is part of the humbug/php-scoper package.
7
 *
8
 * Copyright (c) 2017 Théo FIDRY <[email protected]>,
9
 *                    Pádraic Brady <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace Humbug\PhpScoper\Symbol;
16
17
use Humbug\PhpScoper\Configuration\SymbolsConfiguration;
18
19
final class EnrichedReflectorFactory
20
{
21
    private Reflector $reflector;
22
23
    public function __construct(Reflector $reflector)
24
    {
25
        $this->reflector = $reflector;
26
    }
27
28
    public function create(SymbolsConfiguration $symbolsConfiguration): EnrichedReflector
29
    {
30
        $configuredReflector = $this->reflector->withAdditionalSymbols(
31
            $symbolsConfiguration->getExcludedClasses(),
32
            $symbolsConfiguration->getExcludedFunctions(),
33
            $symbolsConfiguration->getExcludedConstants(),
34
        );
35
36
        return new EnrichedReflector(
37
            $configuredReflector,
38
            $symbolsConfiguration,
39
        );
40
    }
41
}
42