Conditions | 5 |
Paths | 6 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
50 | public function resolveFile(string $file): string |
||
51 | { |
||
52 | $realFile = ('@' === $file[0]) |
||
53 | ? $this->kernel->locateResource($file, null, true) |
||
54 | : $file |
||
55 | ; |
||
56 | |||
57 | $realFile = realpath($realFile); |
||
58 | if (false === $realFile || false === file_exists($realFile)) { |
||
59 | throw new \InvalidArgumentException(sprintf('The file "%s" was not found.', $file)); |
||
60 | } |
||
61 | if (false === is_file($realFile)) { |
||
62 | throw new \InvalidArgumentException( |
||
63 | sprintf('Expected "%s" to be a fixture file, got a directory instead.', $file) |
||
64 | ); |
||
65 | } |
||
66 | |||
67 | return $realFile; |
||
68 | } |
||
69 | } |
||
70 |