Conditions | 3 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | 109 | public static function from(Expectation $expectation): callable |
|
13 | { |
||
14 | 109 | return function ($request) use ($expectation) { |
|
15 | 108 | if ($path = $expectation->getPath()) { |
|
16 | /** @var RequestInterface $request */ |
||
17 | 4 | if ($request->getUri()->getPath() !== $path) { |
|
18 | 1 | return new RejectedPromise('path does not match expectation'); |
|
19 | } |
||
20 | } |
||
21 | |||
22 | 107 | return $request; |
|
23 | }; |
||
26 |