| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 34 | public function createRequest($method, $uri) |
|
| 17 | { |
||
| 18 | |||
| 19 | 34 | if (is_string($uri)) { |
|
| 20 | 12 | $uri = (new UriFactory())->createUri($uri); |
|
| 21 | } |
||
| 22 | |||
| 23 | 34 | if (!$uri instanceof \Psr\Http\Message\UriInterface) { |
|
|
|
|||
| 24 | throw new \InvalidArgumentException('URI must be a instance of ' . \Psr\Http\Message\UriInterface::class); |
||
| 25 | } |
||
| 26 | |||
| 27 | 34 | $body = (new StreamFactory())->createStream(''); |
|
| 28 | |||
| 29 | 34 | return new Request($method, $uri, [], $body); |
|
| 30 | } |
||
| 32 |