We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | private function getFileNameGeneratorInstance(?string $fileNameGenerator): FileNameGeneratorInterface |
||
| 24 | { |
||
| 25 | $fileGeneratorClass = $fileNameGenerator ?? config('backpack.crud.file_name_generator'); |
||
| 26 | |||
| 27 | if (! class_exists($fileGeneratorClass)) { |
||
| 28 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] does not exist."); |
||
| 29 | } |
||
| 30 | |||
| 31 | if (! in_array(FileNameGeneratorInterface::class, class_implements($fileGeneratorClass, false))) { |
||
| 32 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] must implement the [".FileNameGeneratorInterface::class.'] interface.'); |
||
| 33 | } |
||
| 34 | |||
| 35 | return new $fileGeneratorClass(); |
||
| 36 | } |
||
| 38 |