| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | 8 | public static function assertDocumentThumbnailExtension(string $value, string $message = ''): void |
|
| 35 | { |
||
| 36 | 8 | $extension = pathinfo($value, PATHINFO_EXTENSION); |
|
| 37 | 8 | $extension = strtoupper(/** @scrutinizer ignore-type */ $extension); |
|
| 38 | |||
| 39 | 8 | $format = '' === $message |
|
| 40 | 6 | ? '%1$s contains an unsupported document thumbnail format file extension' |
|
| 41 | 2 | : $message; |
|
| 42 | 8 | $message = sprintf($format, self::valueToString($value)); |
|
| 43 | |||
| 44 | 8 | $fileFormats = [...ReportingCloud::FILE_FORMATS_DOCUMENT, ReportingCloud::FILE_FORMAT_XLSX]; |
|
| 45 | |||
| 46 | 8 | self::assertOneOf($extension, $fileFormats, $message); |
|
| 47 | } |
||
| 49 |