Passed
Push — master ( 01e41e...21756f )
by Théo
02:37
created

Reflector   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
ccs 6
cts 6
cp 1
wmc 3
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isClassInternal() 0 8 2
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;
16
17
use Roave\BetterReflection\Reflector\ClassReflector;
18
use Roave\BetterReflection\Reflector\Exception\IdentifierNotFound;
19
20
final class Reflector
21
{
22
    private $classReflector;
23
24 343
    public function __construct(ClassReflector $classReflector)
25
    {
26 343
        $this->classReflector = $classReflector;
27
    }
28
29 200
    public function isClassInternal(string $name): bool
30
    {
31
        try {
32 200
            return $this->classReflector->reflect($name)->isInternal();
33 3
        } catch (IdentifierNotFound $exception) {
34 3
            return false;
35
        }
36
    }
37
}
38