| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | protected function imageUrlValidation($imageUrl) |
||
| 52 | { |
||
| 53 | $fileInfo = new finfo(FILEINFO_MIME_TYPE); |
||
| 54 | $mimeType = $fileInfo->buffer(file_get_contents($imageUrl)); |
||
| 55 | |||
| 56 | if (!in_array($mimeType, $this->supportedMimeTypes)) { |
||
| 57 | throw new \Exception( |
||
| 58 | sprintf( |
||
| 59 | 'Type de fichier non supporté. Types supportés : [%s]', |
||
| 60 | str_replace('image/', '', implode(', ', $this->supportedMimeTypes)) |
||
| 61 | ) |
||
| 75 |