Conditions | 3 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | 121 | public static function from(Expectation $expectation): callable |
|
13 | { |
||
14 | 121 | return function ($request) use ($expectation) { |
|
15 | /** @var RequestInterface $request */ |
||
16 | 121 | if (!is_null($expectation->getMethod()) && $request->getMethod() !== $expectation->getMethod()) { |
|
17 | 2 | return new RejectedPromise('method \'' . $request->getMethod() . '\' does not match expectation'); |
|
18 | } |
||
19 | |||
20 | 119 | return $request; |
|
21 | 121 | }; |
|
24 |