EnrichedReflectorFactory   A
last analyzed

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
/*
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