Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
26 | 4 | private function getObjectType(\ReflectionClass $class): ?Webonyx\ObjectType |
|
27 | { |
||
28 | 4 | $name = $class->getName(); |
|
29 | |||
30 | 4 | if ($this->typeRegistry->has($name)) { |
|
31 | 3 | $type = $this->typeRegistry->get($name); |
|
32 | |||
33 | 3 | return $type instanceof Webonyx\ObjectType |
|
34 | 2 | ? $type |
|
35 | 3 | : null; |
|
36 | } |
||
37 | |||
38 | 2 | if ($parent = $class->getParentClass()) { |
|
39 | 1 | return $this->getObjectType($parent); |
|
40 | } |
||
41 | |||
42 | 1 | return null; |
|
43 | } |
||
45 |