Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
44 | 2 | public static function getLastRequest(): Request |
|
45 | { |
||
46 | 2 | $requestPath = MockServerConfig::getLogsPath().'/'.MockServer::REQUEST_FILE; |
|
47 | 2 | $serialized = file_get_contents($requestPath); |
|
48 | 2 | if (empty($serialized)) { |
|
49 | 1 | throw new \RuntimeException('request log file ['.$requestPath.'] is empty'); |
|
50 | } |
||
51 | |||
52 | 1 | return unserialize($serialized, ['allowed_classes' => [Request::class]]); |
|
53 | } |
||
55 |