| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function canHandle(ReflectionParameter $reflectionParameter, string $url = null) : bool |
||
| 23 | { |
||
| 24 | $class = $reflectionParameter->getClass(); |
||
| 25 | if ($class === null) { |
||
| 26 | return false; |
||
| 27 | } |
||
| 28 | $name = $class->getName(); |
||
|
|
|||
| 29 | // Check type of requested parameter; Only interfaces are allowed in an action of a controller. |
||
| 30 | if ($name === 'Psr\\Http\\Message\\RequestInterface' || $name === 'Psr\\Http\\Message\\ServerRequestInterface') { |
||
| 31 | return true; |
||
| 32 | } else { |
||
| 33 | return false; |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 65 |