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

Reflector::isClassInternal()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
ccs 4
cts 4
cp 1
crap 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