UserDefinedSymbolFilter::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 9
ccs 5
cts 5
cp 1
crap 2
rs 10
1
<?php
2
/**
3
 * Copyright MediaCT. All rights reserved.
4
 * https://www.mediact.nl
5
 */
6
7
namespace Mediact\DependencyGuard\Php\Filter;
8
9
use Mediact\DependencyGuard\Reflection\ReflectionTrait;
10
use Throwable;
11
12
class UserDefinedSymbolFilter implements SymbolFilterInterface
13
{
14
    use ReflectionTrait;
15
16
    /**
17
     * Filter the given symbol.
18
     *
19
     * @param string $symbol
20
     *
21
     * @return bool
22
     */
23 3
    public function __invoke(string $symbol): bool
24
    {
25
        try {
26 3
            $reflection = $this->getClassReflection($symbol);
27 1
        } catch (Throwable $e) {
28 1
            return false;
29
        }
30
31 2
        return !$reflection->isInternal();
32
    }
33
}
34