| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function getFileFields($path) |
||
| 12 | { |
||
| 13 | if (!file_exists($path)) { |
||
| 14 | throw new \RuntimeException(sprintf('File "%s" does not exist', $path)); |
||
| 15 | } |
||
| 16 | |||
| 17 | $content = file_get_contents($path); |
||
| 18 | |||
| 19 | return [ |
||
| 20 | 'name' => basename($path), |
||
| 21 | 'digest' => sha1($content), |
||
| 22 | 'content' => base64_encode($content) |
||
| 23 | ]; |
||
| 42 |