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