| Conditions | 2 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 32 | public static function assertTemplateExtension(string $value, string $message = '') |
|
| 33 | { |
||
| 34 | 32 | $extension = pathinfo($value, PATHINFO_EXTENSION); |
|
| 35 | 32 | $extension = strtoupper($extension); |
|
| 36 | |||
| 37 | 32 | $format = '%s contains an unsupported template format file extension'; |
|
| 38 | 32 | $message = sprintf($message ?: $format, static::valueToString($value)); |
|
| 39 | |||
| 40 | 32 | return static::oneOf($extension, static::getTemplateFormats(), $message); |
|
| 41 | } |
||
| 43 |