We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 7 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class FileNameGenerator implements FileNameGeneratorInterface |
||
| 11 | { |
||
| 12 | public function getName(string|UploadedFile|File $file): string |
||
| 13 | { |
||
| 14 | if (is_object($file) && get_class($file) === File::class) { |
||
| 15 | return $file->getFileName(); |
||
| 16 | } |
||
| 17 | |||
| 18 | return $this->getFileName($file).'.'.$this->getExtensionFromFile($file); |
||
| 19 | } |
||
| 20 | |||
| 21 | private function getExtensionFromFile(string|UploadedFile $file): string |
||
| 24 | } |
||
| 25 | |||
| 26 | private function getFileName(string|UploadedFile $file): string |
||
| 33 | } |
||
| 34 | } |
||
| 35 |