@@ -50,7 +50,9 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | private function addFiles(HasMedia $model, string $type, array $files, array &$files_order, string $locale = null) |
| 52 | 52 | { |
| 53 | - if(!$this->actionExists($files, 'new')) return; |
|
| 53 | + if(!$this->actionExists($files, 'new')) { |
|
| 54 | + return; |
|
| 55 | + } |
|
| 54 | 56 | |
| 55 | 57 | foreach ($files['new'] as $id => $file) { |
| 56 | 58 | if (!$file) { |
@@ -68,7 +70,9 @@ discard block |
||
| 68 | 70 | */ |
| 69 | 71 | private function replaceFiles(HasMedia $model, array $files) |
| 70 | 72 | { |
| 71 | - if(!$this->actionExists($files, 'replace')) return; |
|
| 73 | + if(!$this->actionExists($files, 'replace')) { |
|
| 74 | + return; |
|
| 75 | + } |
|
| 72 | 76 | |
| 73 | 77 | foreach ($files['replace'] as $id => $file) { |
| 74 | 78 | if (!$file) { |
@@ -86,7 +90,9 @@ discard block |
||
| 86 | 90 | */ |
| 87 | 91 | private function removeFiles(HasMedia $model, array $files) |
| 88 | 92 | { |
| 89 | - if(!$this->actionExists($files, 'delete')) return; |
|
| 93 | + if(!$this->actionExists($files, 'delete')) { |
|
| 94 | + return; |
|
| 95 | + } |
|
| 90 | 96 | |
| 91 | 97 | foreach ($model->assets()->whereIn('id', $files['delete'])->get() as $asset) { |
| 92 | 98 | $asset->delete(); |