Completed
Push — refactor ( 878977 )
by Akihito
03:03 queued 01:58
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
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