Passed
Push — ft/urls ( 625b56...d52783 )
by Ben
25:47
created
src/Modules/ModuleManager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,15 +63,15 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $permission = 'update-page';
65 65
 
66
-        if (in_array($verb, ['index','show'])) {
66
+        if (in_array($verb, ['index', 'show'])) {
67 67
             $permission = 'view-page';
68
-        } elseif (in_array($verb, ['create','store'])) {
68
+        } elseif (in_array($verb, ['create', 'store'])) {
69 69
             $permission = 'create-page';
70 70
         } elseif (in_array($verb, ['delete'])) {
71 71
             $permission = 'delete-page';
72 72
         }
73 73
 
74
-        if (! auth()->guard('chief')->user()->hasPermissionTo($permission)) {
74
+        if (!auth()->guard('chief')->user()->hasPermissionTo($permission)) {
75 75
             throw NotAllowedManagerRoute::notAllowedPermission($permission, $this);
76 76
         }
77 77
     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     public function saveFields(): Manager
104 104
     {
105 105
         // Store the morph_key upon creation
106
-        if (! $this->model->morph_key) {
106
+        if (!$this->model->morph_key) {
107 107
             $this->model->morph_key = $this->model->morphKey();
108 108
         }
109 109
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             if (is_array_empty($translation)) {
143 143
 
144 144
                 // Nullify all values
145
-                $trans[$locale] = array_map(function ($value) {
145
+                $trans[$locale] = array_map(function($value) {
146 146
                     return null;
147 147
                 }, $translation);
148 148
                 continue;
Please login to merge, or discard this patch.
src/Media/UploadMedia.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         if (is_string($file)) {
60 60
             $image_name = json_decode($file)->output->name;
61 61
             $asset      = $this->addAsset(json_decode($file)->output->image, $type, null, $image_name, $model);
62
-        } else {
62
+        }else {
63 63
             $image_name = $file->getClientOriginalName();
64 64
             $asset      = $this->addAsset($file, $type, null, $image_name, $model);
65 65
         }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         if (is_string($file)) {
84 84
             $asset = AssetUploader::uploadFromBase64($file, $filename);
85
-        } else {
85
+        }else {
86 86
             $asset = AssetUploader::upload($file, $filename);
87 87
         }
88 88
 
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
      */
127 127
     private function sluggifyFilename($filename): string
128 128
     {
129
-        $extension = substr($filename, strrpos($filename, '.') + 1);
129
+        $extension = substr($filename, strrpos($filename, '.')+1);
130 130
         $filename  = substr($filename, 0, strrpos($filename, '.'));
131
-        $filename  = str_slug($filename) . '.' . $extension;
131
+        $filename  = str_slug($filename).'.'.$extension;
132 132
 
133 133
         return $filename;
134 134
     }
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
                 if ($file instanceof UploadedFile && !$file->isValid()) {
145 145
                     if ($file->getError() == UPLOAD_ERR_INI_SIZE) {
146 146
                         throw new FileTooBigException(
147
-                            'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. ' .
148
-                            'upload_max_filesize: ' . (int)ini_get('upload_max_filesize') . 'MB, ' .
149
-                            'post_max_size: ' . (int)(ini_get('post_max_size')) . 'MB'
147
+                            'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. '.
148
+                            'upload_max_filesize: '.(int)ini_get('upload_max_filesize').'MB, '.
149
+                            'post_max_size: '.(int)(ini_get('post_max_size')).'MB'
150 150
                         );
151 151
                     }
152 152
                 }
Please login to merge, or discard this patch.
src/Filters/Types/InputFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
     public function apply($value = null): Closure
17 17
     {
18
-        return $this->query && $this->query instanceof Closure ? $this->query : function ($query) {
18
+        return $this->query && $this->query instanceof Closure ? $this->query : function($query) {
19 19
             return $query;
20 20
         };
21 21
     }
Please login to merge, or discard this patch.
src/Fields/Types/DocumentField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Thinktomorrow\Chief\Fields\Types;
5 5
 
Please login to merge, or discard this patch.
src/Fields/Types/InputField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Thinktomorrow\Chief\Fields\Types;
5 5
 
Please login to merge, or discard this patch.
src/Fields/Types/RadioField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Thinktomorrow\Chief\Fields\Types;
5 5
 
Please login to merge, or discard this patch.
src/Fields/Types/MediaField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Thinktomorrow\Chief\Fields\Types;
5 5
 
Please login to merge, or discard this patch.
src/Fields/Types/TextField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace Thinktomorrow\Chief\Fields\Types;
5 5
 
Please login to merge, or discard this patch.
src/Management/Details/Sections.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 
65 65
     public function __toString()
66 66
     {
67
-        return (string) $this->get('key');
67
+        return (string)$this->get('key');
68 68
     }
69 69
 
70 70
     /**
Please login to merge, or discard this patch.