UserDefinedSymbolFilter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 20
ccs 5
cts 5
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 2
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