Passed
Push — master ( 3be123...5e47fd )
by Karel
16:47 queued 13s
created
src/Models/Menus.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         'name'
22 22
     ];
23 23
 
24
-    public function __construct( array $attributes = [] ){
24
+    public function __construct(array $attributes = []) {
25 25
         //parent::construct( $attributes );
26 26
         $this->table = config('menu.table_prefix') . config('menu.table_name_menus');
27 27
     }
Please login to merge, or discard this patch.
src/Models/Template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 class Template extends Eloquent
9 9
 {
10
-    public function pages(){
10
+    public function pages() {
11 11
         return $this->hasMany('Chuckbe\Chuckcms\Models\Page');
12 12
     }
13 13
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
         $css = [];
103 103
         $countCss = count($request->css_slug);
104
-        for ($i=0; $i < $countCss; $i++) { 
104
+        for ($i = 0; $i < $countCss; $i++) { 
105 105
             $css[$request->css_slug[$i]]['href'] = $request->css_href[$i];
106 106
             $css[$request->css_slug[$i]]['asset'] = $request->css_asset[$i] == 1 ? 'true' : 'false';
107 107
         }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
         $js = [];
112 112
         $countJs = count($request->js_slug);
113
-        for ($k=0; $k < $countJs; $k++) { 
113
+        for ($k = 0; $k < $countJs; $k++) { 
114 114
             $js[$request->js_slug[$k]]['href'] = $request->js_href[$k];
115 115
             $js[$request->js_slug[$k]]['asset'] = $request->js_asset[$k] == 1 ? 'true' : 'false';
116 116
         }
Please login to merge, or discard this patch.
src/Controllers/UserRoleController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             'role_redirect' => 'max:255|required'
52 52
         ]);
53 53
 
54
-        $role = Role::firstOrCreate(['name' => $request->role_name],['redirect' => $request->role_redirect]);
54
+        $role = Role::firstOrCreate(['name' => $request->role_name], ['redirect' => $request->role_redirect]);
55 55
 
56 56
         return redirect()->route('dashboard.users.roles.edit', ['role' => $role->id])->with('notification', 'Rol aangemaakt!');
57 57
     }
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 
85 85
         $permissions = [];
86 86
         $countPermissions = count($request->permissions_name);
87
-        for ($i=0; $i < $countPermissions; $i++) { 
88
-            if($request->permissions_active[$i] == 1) {
87
+        for ($i = 0; $i < $countPermissions; $i++) { 
88
+            if ($request->permissions_active[$i] == 1) {
89 89
                 $role->givePermissionTo($request->permissions_name[$i]);
90 90
             } else {
91 91
                 $role->revokePermissionTo($request->permissions_name[$i]);
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         ]);
109 109
 
110 110
         $role = Role::findById($request->get('role_id'));
111
-        if ( $role->delete() ) {
111
+        if ($role->delete()) {
112 112
             return redirect()->route('dashboard.users.roles')->with('notification', 'Rol verwijderd!');
113 113
         } else {
114 114
             return redirect()->route('dashboard.users.roles')->with('whoops', 'Er is iets misgegaan, probeer het later nog eens!');
Please login to merge, or discard this patch.
src/Controllers/ContentController.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
         $resource = Resource::firstOrNew(['slug' => $request->get('slug')[0]]);
72 72
         $resource->slug = $request->get('slug')[0];
73 73
         $json = [];
74
-        foreach(ChuckSite::getSupportedLocales() as $langKey => $langValue){
74
+        foreach (ChuckSite::getSupportedLocales() as $langKey => $langValue) {
75 75
             $count = count($request->get('resource_key')[$langKey]);
76
-            for ($i=0; $i < $count; $i++) { 
76
+            for ($i = 0; $i < $count; $i++) { 
77 77
                 $json[$langKey][$request->get('resource_key')[$langKey][$i]] = $request->get('resource_value')[$langKey][$i];
78 78
 
79 79
             }
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $repeater = Content::where('slug', $slug)->first();
110 110
 
111
-        $filename = $repeater->slug.".json";
111
+        $filename = $repeater->slug . ".json";
112 112
         $handle = fopen($filename, 'w+');
113 113
         fputs($handle, $repeater->toJson(JSON_PRETTY_PRINT));
114 114
         fclose($handle);
115 115
         $headers = array('Content-type'=> 'application/json');
116
-        return response()->download($filename,$filename,$headers)->deleteFileAfterSend();
116
+        return response()->download($filename, $filename, $headers)->deleteFileAfterSend();
117 117
 
118 118
         //return view('chuckcms::backend.content.repeater.edit', compact('pageViews', 'repeater'));
119 119
     }
@@ -125,16 +125,16 @@  discard block
 block discarded – undo
125 125
         $content_slug = $request->get('content_slug');
126 126
         $fields_slug = $request->get('fields_slug');
127 127
         $count = count($fields_slug);
128
-        for ($i=0; $i < $count; $i++) { 
129
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['label'] = $request->get('fields_label')[$i];
130
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['type'] = $request->get('fields_type')[$i];
131
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['class'] = $request->get('fields_class')[$i];
132
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['placeholder'] = $request->get('fields_placeholder')[$i];
133
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['validation'] = $request->get('fields_validation')[$i];
134
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['value'] = $request->get('fields_value')[$i];
135
-            $fieldsCount = count(explode(';',$request->get('fields_attributes_name')[$i]));
136
-            for ($k=0; $k < $fieldsCount; $k++) { 
137
-                $content['fields'][$content_slug . '_' . $fields_slug[$i]]['attributes'][explode(';',$request->get('fields_attributes_name')[$i])[$k]] = explode(';',$request->get('fields_attributes_value')[$i])[$k];
128
+        for ($i = 0; $i < $count; $i++) { 
129
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['label'] = $request->get('fields_label')[$i];
130
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['type'] = $request->get('fields_type')[$i];
131
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['class'] = $request->get('fields_class')[$i];
132
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['placeholder'] = $request->get('fields_placeholder')[$i];
133
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['validation'] = $request->get('fields_validation')[$i];
134
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['value'] = $request->get('fields_value')[$i];
135
+            $fieldsCount = count(explode(';', $request->get('fields_attributes_name')[$i]));
136
+            for ($k = 0; $k < $fieldsCount; $k++) { 
137
+                $content['fields'][$content_slug . '_' . $fields_slug[$i]]['attributes'][explode(';', $request->get('fields_attributes_name')[$i])[$k]] = explode(';', $request->get('fields_attributes_value')[$i])[$k];
138 138
             }
139 139
             $content['fields'][$content_slug . '_' . $fields_slug[$i]]['required'] = $request->get('fields_required')[$i];
140 140
             $content['fields'][$content_slug . '_' . $fields_slug[$i]]['table'] = $request->get('fields_table')[$i];
@@ -170,32 +170,32 @@  discard block
 block discarded – undo
170 170
         $file_contents = file_get_contents($request->file('file'));
171 171
 
172 172
         $new_slug = $request->get('slug');
173
-        $old_slug = json_decode($file_contents,true)['slug'];
173
+        $old_slug = json_decode($file_contents, true)['slug'];
174 174
 
175 175
         $json_string = str_replace($old_slug, $new_slug, $file_contents);
176
-        $json_file_array = json_decode($json_string,true);
176
+        $json_file_array = json_decode($json_string, true);
177 177
 
178
-        if ( !array_key_exists('type', $json_file_array) ) {
178
+        if (!array_key_exists('type', $json_file_array)) {
179 179
             $notification = array('type' => 'error', 'message' => 'The "type" key was not present in the JSON file.');
180 180
             return redirect()->route('dashboard.content.repeaters')->with('notification', $notification);
181 181
         }
182 182
 
183
-        if ( !array_key_exists('content', $json_file_array) ) {
183
+        if (!array_key_exists('content', $json_file_array)) {
184 184
             $notification = array('type' => 'error', 'message' => 'The "content" key was not present in the JSON file.');
185 185
             return redirect()->route('dashboard.content.repeaters')->with('notification', $notification);
186 186
         }
187 187
 
188
-        if ( !array_key_exists('fields', $json_file_array['content']) ) {
188
+        if (!array_key_exists('fields', $json_file_array['content'])) {
189 189
             $notification = array('type' => 'error', 'message' => 'The "fields" key was not present in the JSON file.');
190 190
             return redirect()->route('dashboard.content.repeaters')->with('notification', $notification);
191 191
         }
192 192
 
193
-        if ( !array_key_exists('actions', $json_file_array['content']) ) {
193
+        if (!array_key_exists('actions', $json_file_array['content'])) {
194 194
             $notification = array('type' => 'error', 'message' => 'The "actions" key was not present in the JSON file.');
195 195
             return redirect()->route('dashboard.content.repeaters')->with('notification', $notification);
196 196
         }
197 197
 
198
-        if ( !array_key_exists('files', $json_file_array['content']) ) {
198
+        if (!array_key_exists('files', $json_file_array['content'])) {
199 199
             $notification = array('type' => 'error', 'message' => 'The "files" key was not present in the JSON file.');
200 200
             return redirect()->route('dashboard.content.repeaters')->with('notification', $notification);
201 201
         }
Please login to merge, or discard this patch.
src/Controllers/FormController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         $form_slug = $request->get('form_slug');
97 97
         $fields_slug = $request->get('fields_slug');
98 98
         $countFS = count($fields_slug);
99
-        for ($i=0; $i < $countFS; $i++) { 
99
+        for ($i = 0; $i < $countFS; $i++) { 
100 100
             $form['fields'][$form_slug . '_' . $fields_slug[$i]]['label'] = $request->get('fields_label')[$i];
101 101
             $form['fields'][$form_slug . '_' . $fields_slug[$i]]['type'] = $request->get('fields_type')[$i];
102 102
             $form['fields'][$form_slug . '_' . $fields_slug[$i]]['class'] = $request->get('fields_class')[$i];
@@ -104,18 +104,18 @@  discard block
 block discarded – undo
104 104
             $form['fields'][$form_slug . '_' . $fields_slug[$i]]['placeholder'] = $request->get('fields_placeholder')[$i];
105 105
             $form['fields'][$form_slug . '_' . $fields_slug[$i]]['validation'] = $request->get('fields_validation')[$i];
106 106
             $form['fields'][$form_slug . '_' . $fields_slug[$i]]['value'] = $request->get('fields_value')[$i];
107
-            $countFAN = count(explode(';',$request->get('fields_attributes_name')[$i]));
108
-            for ($k=0; $k < $countFAN; $k++) { 
109
-                $form['fields'][$form_slug . '_' . $fields_slug[$i]]['attributes'][explode(';',$request->get('fields_attributes_name')[$i])[$k]] = explode(';',$request->get('fields_attributes_value')[$i])[$k];
107
+            $countFAN = count(explode(';', $request->get('fields_attributes_name')[$i]));
108
+            for ($k = 0; $k < $countFAN; $k++) { 
109
+                $form['fields'][$form_slug . '_' . $fields_slug[$i]]['attributes'][explode(';', $request->get('fields_attributes_name')[$i])[$k]] = explode(';', $request->get('fields_attributes_value')[$i])[$k];
110 110
             }
111 111
             $form['fields'][$form_slug . '_' . $fields_slug[$i]]['required'] = $request->get('fields_required')[$i];
112 112
         }
113 113
 
114 114
         $form['actions']['store'] = $request->get('action_store') == "true" ? true : false;
115 115
         
116
-        if($request->get('action_send') !== 'false' && $request->get('action_send') !== false) {
116
+        if ($request->get('action_send') !== 'false' && $request->get('action_send') !== false) {
117 117
             $countActions = count($request->get('action_send_slug'));
118
-            for ($g=0; $g < $countActions; $g++) { 
118
+            for ($g = 0; $g < $countActions; $g++) { 
119 119
                 $form['actions']['send'][$request->get('action_send_slug')[$g]]['to'] = $request->get('action_send_to')[$g];
120 120
                 $form['actions']['send'][$request->get('action_send_slug')[$g]]['to_name'] = $request->get('action_send_to_name')[$g];
121 121
                 $form['actions']['send'][$request->get('action_send_slug')[$g]]['from'] = $request->get('action_send_from')[$g];
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         $store = $form->storeEntry($request);
158 158
         if ($store !== 'error') {
159 159
             //send emails 
160
-            if($form->form['actions']['send'] !== false){
160
+            if ($form->form['actions']['send'] !== false) {
161 161
                 foreach ($form->form['actions']['send'] as $sendKey => $sendValue) {
162 162
                     $mailData = $form->getMailData($sendValue, $request, $store);
163 163
                     Mail::send(new FormActionMail($mailData));
Please login to merge, or discard this patch.
src/Chuck/Accessors/Repeater.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         $this->repeaterRepository = $repeaterRepository;
19 19
     }
20 20
 
21
-    public function for(string $string)
21
+    public function for (string $string)
22 22
     {
23 23
         return $this->repeater->where('slug', $string)->get();
24 24
     }
Please login to merge, or discard this patch.
src/Controllers/PageBlockController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function addBlockTop(Request $request)
121 121
     {
122
-        if($request->has('lang')) {
122
+        if ($request->has('lang')) {
123 123
             app()->setLocale($request->get('lang'));
124 124
         } 
125 125
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     public function addBlockBottom(Request $request)
141 141
     {
142
-        if($request->has('lang')) {
142
+        if ($request->has('lang')) {
143 143
             app()->setLocale($request->get('lang'));
144 144
         } 
145 145
 
Please login to merge, or discard this patch.
src/Chuck/ModuleRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
         // updateOrCreate the module
12 12
         $find = Module::where('slug', $array['slug'])->first();
13 13
 
14
-        if($find == null) {
14
+        if ($find == null) {
15 15
             $result = Module::create($array);
16 16
         } else {
17 17
             $result = $find->update($array);
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     public static function get($slug = null)
24 24
     {
25
-        if(!is_null($slug)) {
25
+        if (!is_null($slug)) {
26 26
             return Module::where('slug', $slug)->firstOrFail();
27 27
         }
28 28
 
Please login to merge, or discard this patch.
src/Models/Module.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,15 +28,15 @@
 block discarded – undo
28 28
 
29 29
     public function getSettingsAttribute()
30 30
     {
31
-        if(array_key_exists('settings', $this->json)) {
31
+        if (array_key_exists('settings', $this->json)) {
32 32
             return $this->json['settings'];
33 33
         }
34 34
         
35
-        if(!array_key_exists('admin', $this->json)) {
35
+        if (!array_key_exists('admin', $this->json)) {
36 36
             return array();
37 37
         }
38 38
 
39
-        if(!array_key_exists('settings', $this->json['admin'])) {
39
+        if (!array_key_exists('settings', $this->json['admin'])) {
40 40
             return array();
41 41
         }
42 42
 
Please login to merge, or discard this patch.