Test Failed
Push — dev ( 03caf0...a74f67 )
by
unknown
05:10
created
src/Lincable/MediaManager.php 1 patch
Spacing   +14 added lines, -15 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $this->app = $app;
52 52
         $this->urlGenerator = $urlGenerator;
53
-        $this->disk = $app['filesystem']->disk($this->config('disk'));
53
+        $this->disk = $app[ 'filesystem' ]->disk($this->config('disk'));
54 54
     }
55 55
 
56 56
     /**
@@ -138,28 +138,28 @@  discard block
 block discarded – undo
138 138
     public function upload(
139 139
         File $media, 
140 140
         Model $model,
141
-        $options = []
141
+        $options = [ ]
142 142
     ) {
143 143
         $this->supportLincable($model);
144 144
 
145 145
         // Create the model link.        
146 146
         $link = $this->newLink($model);
147 147
 
148
-        return rescue(function () use ($link, $media, $model, $options) {
148
+        return rescue(function() use ($link, $media, $model, $options) {
149 149
             // Define the arguments list and method to the media upload.
150
-            list($arguments, $putMethod) = [[$link, $media], 'putFile'];
150
+            list($arguments, $putMethod) = [ [ $link, $media ], 'putFile' ];
151 151
 
152 152
             // Determine if the model should overwrite the same filename.
153 153
             // Then the media filename is inserted into the arguments 
154 154
             // and we change the upload method to accept a filename. 
155 155
             if ($model->shouldOverwrite()) {
156
-                $arguments[] = $model->getFileName();
156
+                $arguments[ ] = $model->getFileName();
157 157
                 $putMethod = 'putFileAs';
158 158
             } 
159 159
 
160 160
             // Here we allow custom upload options that is independent from 
161 161
             // the method used.
162
-            $arguments[] = $options;
162
+            $arguments[ ] = $options;
163 163
             
164 164
             $url = $this->disk->$putMethod(...$arguments);
165 165
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             event(new UploadSuccess($model, $media));
170 170
             
171 171
             return $model;
172
-        }, function () use ($model, $media) {
172
+        }, function() use ($model, $media) {
173 173
             // Send the event that the upload has failed.
174 174
             event(new UploadFailure($model, $media));
175 175
 
@@ -187,13 +187,12 @@  discard block
 block discarded – undo
187 187
       */
188 188
     public function copy(Model $from, Model $to, bool $preserveName = null)
189 189
     {
190
-        $this->supportLincable([$from, $to]);
190
+        $this->supportLincable([ $from, $to ]);
191 191
 
192 192
         $path = $this->newLink(
193 193
             $to,
194 194
             $preserveName ? 
195
-                $from->getFileName() : 
196
-                str_random(40).'.'.$from->getExtension()
195
+                $from->getFileName() : str_random(40).'.'.$from->getExtension()
197 196
         );
198 197
         
199 198
         $this->disk->copy($from->getRawUrl(), $path);
@@ -216,7 +215,7 @@  discard block
 block discarded – undo
216 215
             $modelUrl = $path->getRawUrl();
217 216
 
218 217
             // Do not keep the model on.
219
-            if (! $dryRun) {
218
+            if (!$dryRun) {
220 219
                 $path->delete();
221 220
             }
222 221
 
@@ -293,7 +292,7 @@  discard block
 block discarded – undo
293 292
 
294 293
         $modelClass = get_class($model);
295 294
         
296
-        if (! $this->hasLincableTrait($modelClass)) {
295
+        if (!$this->hasLincableTrait($modelClass)) {
297 296
             throw new Exception("The model [$modelClass] does not support Lincable.");
298 297
         } 
299 298
     }
@@ -343,10 +342,10 @@  discard block
 block discarded – undo
343 342
         } 
344 343
 
345 344
         if (
346
-            $arguments[0] instanceof Model && 
347
-            $this->hasLincableTrait(get_class($arguments[0]))
345
+            $arguments[ 0 ] instanceof Model && 
346
+            $this->hasLincableTrait(get_class($arguments[ 0 ]))
348 347
         ) {    
349
-            $arguments[0] = $arguments[0]->getRawUrl();
348
+            $arguments[ 0 ] = $arguments[ 0 ]->getRawUrl();
350 349
         }
351 350
 
352 351
         return $this->forwardCallTo($this->disk, $name, $arguments);
Please login to merge, or discard this patch.