Completed
Push — refactor ( 878977 )
by Akihito
03:03 queued 01:58
created

NewReflectionClass::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
6
namespace Ray\Di;
7
8
use Ray\Di\Exception\NotFound;
9
10
final class NewReflectionClass
11
{
12
    public function __invoke(string $class) : \ReflectionClass
13
    {
14
        if (! class_exists($class)) {
15
            throw new NotFound($class);
16
        }
17
18
        return new \ReflectionClass($class);
19
    }
20
}
21