| Conditions | 3 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public static function createReqHandlerMock(ResponseInterface $response = null, RequestInterface $request = null) |
||
| 18 | { |
||
| 19 | $argument = $request ?: Argument::any(); |
||
| 20 | $delegate = static::getProphet()->prophesize(RequestHandlerInterface::class); |
||
|
|
|||
| 21 | $delegate->handle($argument)->willReturn($response ?: new Response()); |
||
| 22 | |||
| 23 | return $delegate; |
||
| 24 | } |
||
| 25 | |||
| 38 |
Let’s assume you have a class which uses late-static binding:
}
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClassto useselfinstead: