| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | private function handleSVGFile($file) |
||
| 32 | { |
||
| 33 | $handle = fopen($file->getPathname(), 'r+'); |
||
| 34 | $contents = fread($handle, filesize($file->getPathname())); |
||
| 35 | |||
| 36 | rewind($handle); |
||
| 37 | |||
| 38 | // If the file starts with <svg the XML declaration is missing |
||
| 39 | if (Str::startsWith($contents, '<svg')) { |
||
| 40 | // Add XML declaration |
||
| 41 | fwrite($handle, $this->xmlDeclaration.PHP_EOL.$contents); |
||
| 42 | } |
||
| 43 | |||
| 44 | fclose($handle); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |