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 |
||
24 | private function getFileNameGeneratorInstance(?string $fileNameGenerator): FileNameGeneratorInterface |
||
25 | { |
||
26 | $fileGeneratorClass = $fileNameGenerator ?? config('backpack.crud.file_name_generator'); |
||
27 | |||
28 | if (! class_exists($fileGeneratorClass)) { |
||
29 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] does not exist."); |
||
30 | } |
||
31 | |||
32 | if (! in_array(FileNameGeneratorInterface::class, class_implements($fileGeneratorClass, false))) { |
||
33 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] must implement the [".FileNameGeneratorInterface::class.'] interface.'); |
||
34 | } |
||
35 | |||
36 | return new $fileGeneratorClass(); |
||
37 | } |
||
39 |