Completed
Push — 2.x ( e1da9c...c98d72 )
by Akihito
02:48
created

NewReflectionClass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

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