Completed
Push — 2.x ( e1da9c...c98d72 )
by Akihito
02:48
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
namespace Ray\Di;
6
7
use Ray\Di\Exception\NotFound;
8
9
final class NewReflectionClass
10
{
11
    public function __invoke(string $class) : \ReflectionClass
12
    {
13
        if (! class_exists($class)) {
14
            throw new NotFound($class);
15
        }
16
17
        return new \ReflectionClass($class);
18
    }
19
}
20