Passed
Push — master ( ee13c0...fd5ab9 )
by Koldo
02:31
created

GetClassNameFromFQCN::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 8
ccs 0
cts 7
cp 0
crap 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Antidot\DevTools\Application\Service;
6
7
use function is_bool;
8
use function strrchr;
9
use function substr;
10
11
class GetClassNameFromFQCN
12
{
13
    public function __invoke(string $fqcn): string
14
    {
15
        $index = strrchr($fqcn, "\\");
16
        if (is_bool($index)) {
0 ignored issues
show
introduced by
The condition is_bool($index) is always false.
Loading history...
17
            return $fqcn;
18
        }
19
20
        return substr($index, 1);
21
    }
22
}
23