Conditions | 3 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public static function createDelegateMock(ResponseInterface $response = null, RequestInterface $request = null) |
||
16 | { |
||
17 | $argument = $request ?: Argument::any(); |
||
18 | $delegate = static::getProphet()->prophesize(DelegateInterface::class); |
||
|
|||
19 | $delegate->process($argument)->willReturn($response ?: new Response()); |
||
20 | |||
21 | return $delegate; |
||
22 | } |
||
23 | |||
36 |
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
SomeClass
to useself
instead: