Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#124)
by Owen
05:13
created
src/CrudTrait.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         foreach ($columns as $key => $column) {
51 51
             $column_contents = $this->{$column};
52 52
 
53
-            if (! is_object($this->{$column})) {
53
+            if (!is_object($this->{$column})) {
54 54
                 $column_contents = json_decode($this->{$column});
55 55
             }
56 56
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         $model = '\\'.get_class($this);
75 75
 
76
-        if (! count($columns)) {
76
+        if (!count($columns)) {
77 77
             $columns = (property_exists($model, 'fakeColumns')) ? $this->fakeColumns : ['extras'];
78 78
         }
79 79
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             $attribute_value = (array) $this->{$attribute_name};
164 164
             foreach ($files_to_clear as $key => $filename) {
165 165
                 \Storage::disk($disk)->delete($filename);
166
-                $attribute_value = array_where($attribute_value, function ($value, $key) use ($filename) {
166
+                $attribute_value = array_where($attribute_value, function($value, $key) use ($filename) {
167 167
                     return $value != $filename;
168 168
                 });
169 169
             }
@@ -207,17 +207,17 @@  discard block
 block discarded – undo
207 207
      */
208 208
     public function uploadImageToDisk($value, $attribute_name, $disk, $destination_path, $variations = null)
209 209
     {
210
-        if (! $variations || ! is_array($variations)) {
210
+        if (!$variations || !is_array($variations)) {
211 211
             $variations = ['original' => null, 'thumb' => [150, 150]];
212 212
         }
213 213
 
214 214
         //Needed for the original image
215
-        if (! array_key_exists('original', $variations)) {
215
+        if (!array_key_exists('original', $variations)) {
216 216
             $variations['original'] = null;
217 217
         }
218 218
 
219 219
         //Needed for admin thumbnails
220
-        if (! array_key_exists('thumb', $variations)) {
220
+        if (!array_key_exists('thumb', $variations)) {
221 221
             $variations['thumb'] = [150, 150];
222 222
         }
223 223
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         }
237 237
 
238 238
         // if a new file is uploaded, delete the file from the disk
239
-        if ( ($request->hasFile($attribute_name) || starts_with($value, 'data:image')) && $this->{$attribute_name} ) {
239
+        if (($request->hasFile($attribute_name) || starts_with($value, 'data:image')) && $this->{$attribute_name} ) {
240 240
             foreach ($variations as $variant => $dimensions) {
241 241
                 $variant_name = str_replace('-original', '-'.$variant, $this->{$attribute_name});
242 242
                 \Storage::disk($disk)->delete($variant_name);
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                         $height = $dimensions[1];
279 279
 
280 280
                         if ($img->width() > $width || $img->height() > $height) {
281
-                            $img->resize($width, $height, function ($constraint) {
281
+                            $img->resize($width, $height, function($constraint) {
282 282
                                 $constraint->aspectRatio();
283 283
                             })
284 284
                             ->save($disk_root.'/'.$variant_file);
@@ -300,18 +300,18 @@  discard block
 block discarded – undo
300 300
             // 3. Save the complete path to the database
301 301
             $this->attributes[$attribute_name] = $image_variations['original'];
302 302
 
303
-        } elseif( starts_with($value, 'data:image') ) {
303
+        } elseif (starts_with($value, 'data:image')) {
304 304
 
305 305
             $img = \Image::make($value);
306 306
             $new_file_name = md5($value.time());
307 307
 
308
-            if( !\Illuminate\Support\Facades\File::exists($destination_path) ){
308
+            if (!\Illuminate\Support\Facades\File::exists($destination_path)) {
309 309
                 \Illuminate\Support\Facades\File::makeDirectory($destination_path, 0775, true);
310 310
             }
311 311
 
312 312
             foreach ($variations as $variant => $dimensions) {
313 313
 
314
-                switch( $img->mime() ) {
314
+                switch ($img->mime()) {
315 315
                     case 'image/bmp':
316 316
                     case 'image/ief':
317 317
                     case 'image/jpeg':
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                     $height = $dimensions[1];
341 341
 
342 342
                     if ($img->width() > $width || $img->height() > $height) {
343
-                        $img->resize($width, $height, function ($constraint) {
343
+                        $img->resize($width, $height, function($constraint) {
344 344
                             $constraint->aspectRatio();
345 345
                         })
346 346
                         ->save($disk_root.'/'.$variant_file);
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
     {
372 372
         $image = $this->attributes['image'];
373 373
         $url = null;
374
-        if (! empty($image)) {
374
+        if (!empty($image)) {
375 375
 
376 376
             $image_variant = str_replace('-original', '-'.$variant, $image);
377 377
 
@@ -387,13 +387,13 @@  discard block
 block discarded – undo
387 387
                     $public_path = $disk_root;
388 388
                 }
389 389
 
390
-                if( \Storage::disk($disk)->exists($image_variant) ){
390
+                if (\Storage::disk($disk)->exists($image_variant)) {
391 391
                     $url = asset($public_path.'/'.$image_variant);
392 392
                 } else {
393 393
                     $url = asset($public_path.'/'.trim($image, '/'));
394 394
                 }
395 395
             } else {
396
-                if( \Storage::exists($image_variant) ){
396
+                if (\Storage::exists($image_variant)) {
397 397
                     $url = \Storage::url(trim($image_variant, '/'));
398 398
                 } else {
399 399
                     $url = url($image);
Please login to merge, or discard this patch.