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