Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
14 | public function canBeConstructed($class) |
||
15 | { |
||
16 | $class = $this->buildReflection($class); |
||
17 | |||
18 | if ($class->isInterface()) { |
||
19 | return false; |
||
20 | } |
||
21 | |||
22 | if ($class->isAbstract()) { |
||
23 | return false; |
||
24 | } |
||
25 | |||
26 | if (null === $constuctor = $class->getConstructor()) { |
||
27 | return true; |
||
28 | } |
||
29 | |||
30 | return 0 === $constuctor->getNumberOfRequiredParameters(); |
||
31 | } |
||
32 | |||
51 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.