We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /******************************* |
57 | 57 | * Static methods |
58 | 58 | *******************************/ |
59 | - public static function for(array $crudObject, array $definition): UploaderInterface |
|
59 | + public static function for (array $crudObject, array $definition): UploaderInterface |
|
60 | 60 | { |
61 | 61 | return new static($crudObject, $definition); |
62 | 62 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public function deleteUploadedFiles(Model $entry): void |
88 | 88 | { |
89 | 89 | if ($this->deleteWhenEntryIsDeleted) { |
90 | - if (! in_array(SoftDeletes::class, class_uses_recursive($entry), true)) { |
|
90 | + if (!in_array(SoftDeletes::class, class_uses_recursive($entry), true)) { |
|
91 | 91 | $this->performFileDeletion($entry); |
92 | 92 | |
93 | 93 | return; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $value = $entry->{$this->name}; |
176 | 176 | |
177 | 177 | if ($this->handleMultipleFiles) { |
178 | - if (! isset($entry->getCasts()[$this->name]) && is_string($value)) { |
|
178 | + if (!isset($entry->getCasts()[$this->name]) && is_string($value)) { |
|
179 | 179 | $entry->{$this->name} = json_decode($value, true); |
180 | 180 | } |
181 | 181 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | |
194 | 194 | if ($this->handleMultipleFiles) { |
195 | 195 | // ensure we have an array of values when field is not casted in model. |
196 | - if (! isset($entry->getCasts()[$this->name]) && is_string($values)) { |
|
196 | + if (!isset($entry->getCasts()[$this->name]) && is_string($values)) { |
|
197 | 197 | $values = json_decode($values, true); |
198 | 198 | } |
199 | 199 | foreach ($values as $value) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | private function performFileDeletion(Model $entry) |
211 | 211 | { |
212 | - if ($this->isRelationship || ! $this->handleRepeatableFiles) { |
|
212 | + if ($this->isRelationship || !$this->handleRepeatableFiles) { |
|
213 | 213 | $this->deleteFiles($entry); |
214 | 214 | |
215 | 215 | return; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | class FileNameGenerator implements FileNameGeneratorInterface |
11 | 11 | { |
12 | - public function getName(string|UploadedFile|File $file): string |
|
12 | + public function getName(string | UploadedFile | File $file): string |
|
13 | 13 | { |
14 | 14 | if (is_object($file) && get_class($file) === File::class) { |
15 | 15 | return $file->getFileName(); |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | return $this->getFileName($file).'.'.$this->getExtensionFromFile($file); |
19 | 19 | } |
20 | 20 | |
21 | - private function getExtensionFromFile(string|UploadedFile $file): string |
|
21 | + private function getExtensionFromFile(string | UploadedFile $file): string |
|
22 | 22 | { |
23 | 23 | return is_a($file, UploadedFile::class, true) ? $file->extension() : Str::after(mime_content_type($file), '/'); |
24 | 24 | } |
25 | 25 | |
26 | - private function getFileName(string|UploadedFile $file): string |
|
26 | + private function getFileName(string | UploadedFile $file): string |
|
27 | 27 | { |
28 | 28 | if (is_file($file)) { |
29 | 29 | return Str::of($file->getClientOriginalName())->beforeLast('.')->slug()->append('-'.Str::random(4)); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | { |
11 | 11 | public mixed $fileNamer = null; |
12 | 12 | |
13 | - public function getFileName(string|UploadedFile|File $file): string |
|
13 | + public function getFileName(string | UploadedFile | File $file): string |
|
14 | 14 | { |
15 | 15 | return is_callable($this->fileNamer) ? ($this->fileNamer)($file, $this) : $this->fileNamer->getName($file); |
16 | 16 | } |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | { |
20 | 20 | $fileGeneratorClass = $fileNameGenerator ?? config('backpack.crud.file_name_generator'); |
21 | 21 | |
22 | - if (! class_exists($fileGeneratorClass)) { |
|
22 | + if (!class_exists($fileGeneratorClass)) { |
|
23 | 23 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] does not exist."); |
24 | 24 | } |
25 | 25 | |
26 | - if (! in_array(FileNameGeneratorInterface::class, class_implements($fileGeneratorClass, false))) { |
|
26 | + if (!in_array(FileNameGeneratorInterface::class, class_implements($fileGeneratorClass, false))) { |
|
27 | 27 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] must implement the [".FileNameGeneratorInterface::class.'] interface.'); |
28 | 28 | } |
29 | 29 |