We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | 27 | public function solveType($expr, $parentClass = self::TYPE_CLASS) |
|
27 | { |
||
28 | 27 | $type = $this->typeResolver->resolve($expr); |
|
29 | |||
30 | 27 | if (null !== $parentClass && !$type instanceof $parentClass) { |
|
31 | 1 | throw new \InvalidArgumentException( |
|
32 | 1 | sprintf('Invalid type! Must be instance of "%s"', $parentClass) |
|
33 | 1 | ); |
|
34 | } |
||
35 | |||
36 | 26 | return $type; |
|
37 | } |
||
38 | |||
55 |