Passed
Push — master ( 9f3154...ff0365 )
by Karel
19:17
created
src/Providers/ChuckRepeaterServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      */
26 26
     public function register()
27 27
     {
28
-        $this->app->bind('ChuckRepeater', function () {
28
+        $this->app->bind('ChuckRepeater', function() {
29 29
             return new \Chuckbe\Chuckcms\Chuck\Accessors\Repeater(\App::make(Repeater::class), \App::make(RepeaterRepository::class));
30 30
         });
31 31
     }
Please login to merge, or discard this patch.
src/Providers/ChuckMenuServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     public function register()
25 25
     {
26
-        $this->app->bind('ChuckMenu', function () {
26
+        $this->app->bind('ChuckMenu', function() {
27 27
             return new \Chuckbe\Chuckcms\Chuck\Accessors\Menu();
28 28
         });
29 29
     }
Please login to merge, or discard this patch.
src/Controllers/FrontEndController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
 
66 66
             $repeater = $this->repeater->where('url', $slug)->first();
67 67
             if ($repeater !== null) {
68
-                $templateHintpath = explode('::', (string) $repeater->page)[0];
68
+                $templateHintpath = explode('::', (string)$repeater->page)[0];
69 69
                 $template = $this->template->where('active', 1)->where('hintpath', $templateHintpath)->first();
70 70
 
71
-                return view((string) $repeater->page, compact('template', 'repeater'));
71
+                return view((string)$repeater->page, compact('template', 'repeater'));
72 72
             }
73 73
 
74
-            $page = $this->page->where('slug->'.app()->getLocale(), $slug)->first();
74
+            $page = $this->page->where('slug->' . app()->getLocale(), $slug)->first();
75 75
             if ($page == null) {
76 76
                 foreach (\LaravelLocalization::getSupportedLocales() as $localeCode => $properties) {
77
-                    $page = $this->page->where('slug->'.$localeCode, $slug)->first();
77
+                    $page = $this->page->where('slug->' . $localeCode, $slug)->first();
78 78
                     if ($page !== null && $localeCode == app()->getLocale()) {
79 79
                         break;
80 80
                     }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
                         app()->setLocale($localeCode);
85 85
                         \LaravelLocalization::setLocale($localeCode);
86 86
 
87
-                        return redirect($localeCode.'/'.$slug);
87
+                        return redirect($localeCode . '/' . $slug);
88 88
                     }
89 89
                 }
90 90
             }
@@ -127,6 +127,6 @@  discard block
 block discarded – undo
127 127
 
128 128
         $template = $this->template->where('active', 1)->where('id', $page->template_id)->first();
129 129
 
130
-        return view($template->hintpath.'::templates.'.$template->slug.'.page', compact('template', 'page', 'pageblocks'));
130
+        return view($template->hintpath . '::templates.' . $template->slug . '.page', compact('template', 'page', 'pageblocks'));
131 131
     }
132 132
 }
Please login to merge, or discard this patch.
src/Controllers/MenuController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
     {
105 105
         $menuitem = new MenuItems();
106 106
         $menuitem->label = request()->input('labelmenu');
107
-        $menuitem->link = 'page:'.request()->input('linkmenu');
107
+        $menuitem->link = 'page:' . request()->input('linkmenu');
108 108
         $menuitem->menu = request()->input('idmenu');
109 109
         $menuitem->sort = MenuItems::getNextSortRoot(request()->input('idmenu'));
110 110
         $menuitem->save();
Please login to merge, or discard this patch.
src/Controllers/PageController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -206,14 +206,14 @@  discard block
 block discarded – undo
206 206
         if ($request->has('lang')) {
207 207
             app()->setLocale($request->get('lang'));
208 208
         } else {
209
-            return redirect()->to(URL::current().'?lang='.app()->getLocale());
209
+            return redirect()->to(URL::current() . '?lang=' . app()->getLocale());
210 210
         }
211 211
         $page = $this->page->getByIdWithBlocks($page_id);
212 212
         $template = $this->template->where('id', $page->template_id)->first();
213 213
         $pageblocks = $this->pageBlockRepository->getRenderedByPageBlocks($this->pageblock->getAllByPageId($page->id));
214 214
 
215
-        $block_dir = array_slice(scandir('chuckbe/'.$template->slug.'/blocks'), 2);
216
-        $blocks = $this->dirToArray($template->path.'/blocks');
215
+        $block_dir = array_slice(scandir('chuckbe/' . $template->slug . '/blocks'), 2);
216
+        $blocks = $this->dirToArray($template->path . '/blocks');
217 217
 
218 218
         return view('chuckcms::backend.pages.pagebuilder.index', compact('template', 'page', 'pageblocks', 'blocks'));
219 219
     }
@@ -225,24 +225,24 @@  discard block
 block discarded – undo
225 225
         $cdir = scandir($dir);
226 226
         foreach ($cdir as $key => $value) {
227 227
             if (!in_array($value, ['.', '..'])) {
228
-                if (is_dir($dir.DIRECTORY_SEPARATOR.$value)) {
229
-                    $result[$value] = $this->dirToArray($dir.DIRECTORY_SEPARATOR.$value);
228
+                if (is_dir($dir . DIRECTORY_SEPARATOR . $value)) {
229
+                    $result[$value] = $this->dirToArray($dir . DIRECTORY_SEPARATOR . $value);
230 230
                 } else {
231 231
                     if ($value !== '.DS_Store' && (strpos($value, '.html') !== false)) {
232 232
                         $blockKey = str_replace('.html', '', $value);
233 233
                         $blockName = str_replace('-', ' ', $blockKey);
234
-                        if (file_exists($dir.DIRECTORY_SEPARATOR.$blockKey.'.jpg')) {
235
-                            $blockImage = $dir.DIRECTORY_SEPARATOR.$blockKey.'.jpg';
236
-                        } elseif (file_exists($dir.DIRECTORY_SEPARATOR.$blockKey.'.jpeg')) {
237
-                            $blockImage = $dir.DIRECTORY_SEPARATOR.$blockKey.'.jpeg';
238
-                        } elseif (file_exists($dir.DIRECTORY_SEPARATOR.$blockKey.'.png')) {
239
-                            $blockImage = $dir.DIRECTORY_SEPARATOR.$blockKey.'.png';
234
+                        if (file_exists($dir . DIRECTORY_SEPARATOR . $blockKey . '.jpg')) {
235
+                            $blockImage = $dir . DIRECTORY_SEPARATOR . $blockKey . '.jpg';
236
+                        } elseif (file_exists($dir . DIRECTORY_SEPARATOR . $blockKey . '.jpeg')) {
237
+                            $blockImage = $dir . DIRECTORY_SEPARATOR . $blockKey . '.jpeg';
238
+                        } elseif (file_exists($dir . DIRECTORY_SEPARATOR . $blockKey . '.png')) {
239
+                            $blockImage = $dir . DIRECTORY_SEPARATOR . $blockKey . '.png';
240 240
                         } else {
241 241
                             $blockImage = 'https://ui-avatars.com/api/?length=5&size=150&name=BLOCK&background=0D8ABC&color=fff&font-size=0.2';
242 242
                         }
243 243
                         $result[$blockKey] = [
244 244
                             'name'     => $blockName,
245
-                            'location' => $dir.DIRECTORY_SEPARATOR.$value,
245
+                            'location' => $dir . DIRECTORY_SEPARATOR . $value,
246 246
                             'img'      => $blockImage,
247 247
                         ];
248 248
                     }
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
         if ($request->has('lang')) {
264 264
             app()->setLocale($request->get('lang'));
265 265
         } else {
266
-            return redirect()->to(URL::current().'?lang='.app()->getLocale());
266
+            return redirect()->to(URL::current() . '?lang=' . app()->getLocale());
267 267
         }
268 268
         $page = $this->page->getByIdWithBlocks($page_id);
269 269
         $template = $this->template->where('id', $page->template_id)->first();
Please login to merge, or discard this patch.
src/Controllers/FormController.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
         $form_slug = $request->get('slug');
55 55
         $fields_slug = 'text';
56 56
 
57
-        $form['fields'][$form_slug.'_'.$fields_slug]['label'] = 'Text';
58
-        $form['fields'][$form_slug.'_'.$fields_slug]['type'] = 'text';
59
-        $form['fields'][$form_slug.'_'.$fields_slug]['class'] = 'form-control';
60
-        $form['fields'][$form_slug.'_'.$fields_slug]['parentclass'] = null;
61
-        $form['fields'][$form_slug.'_'.$fields_slug]['placeholder'] = 'Text';
62
-        $form['fields'][$form_slug.'_'.$fields_slug]['validation'] = 'required';
63
-        $form['fields'][$form_slug.'_'.$fields_slug]['value'] = null;
64
-        $form['fields'][$form_slug.'_'.$fields_slug]['attributes']['id'] = 'text_input_id';
65
-        $form['fields'][$form_slug.'_'.$fields_slug]['required'] = 'true';
57
+        $form['fields'][$form_slug . '_' . $fields_slug]['label'] = 'Text';
58
+        $form['fields'][$form_slug . '_' . $fields_slug]['type'] = 'text';
59
+        $form['fields'][$form_slug . '_' . $fields_slug]['class'] = 'form-control';
60
+        $form['fields'][$form_slug . '_' . $fields_slug]['parentclass'] = null;
61
+        $form['fields'][$form_slug . '_' . $fields_slug]['placeholder'] = 'Text';
62
+        $form['fields'][$form_slug . '_' . $fields_slug]['validation'] = 'required';
63
+        $form['fields'][$form_slug . '_' . $fields_slug]['value'] = null;
64
+        $form['fields'][$form_slug . '_' . $fields_slug]['attributes']['id'] = 'text_input_id';
65
+        $form['fields'][$form_slug . '_' . $fields_slug]['required'] = 'true';
66 66
 
67 67
         $form['actions']['store'] = true;
68 68
         $form['actions']['send'] = false;
@@ -99,18 +99,18 @@  discard block
 block discarded – undo
99 99
         $fields_slug = $request->get('fields_slug');
100 100
         $countFS = count($fields_slug);
101 101
         for ($i = 0; $i < $countFS; $i++) {
102
-            $form['fields'][$form_slug.'_'.$fields_slug[$i]]['label'] = $request->get('fields_label')[$i];
103
-            $form['fields'][$form_slug.'_'.$fields_slug[$i]]['type'] = $request->get('fields_type')[$i];
104
-            $form['fields'][$form_slug.'_'.$fields_slug[$i]]['class'] = $request->get('fields_class')[$i];
105
-            $form['fields'][$form_slug.'_'.$fields_slug[$i]]['parentclass'] = $request->get('fields_parentclass')[$i];
106
-            $form['fields'][$form_slug.'_'.$fields_slug[$i]]['placeholder'] = $request->get('fields_placeholder')[$i];
107
-            $form['fields'][$form_slug.'_'.$fields_slug[$i]]['validation'] = $request->get('fields_validation')[$i];
108
-            $form['fields'][$form_slug.'_'.$fields_slug[$i]]['value'] = $request->get('fields_value')[$i];
102
+            $form['fields'][$form_slug . '_' . $fields_slug[$i]]['label'] = $request->get('fields_label')[$i];
103
+            $form['fields'][$form_slug . '_' . $fields_slug[$i]]['type'] = $request->get('fields_type')[$i];
104
+            $form['fields'][$form_slug . '_' . $fields_slug[$i]]['class'] = $request->get('fields_class')[$i];
105
+            $form['fields'][$form_slug . '_' . $fields_slug[$i]]['parentclass'] = $request->get('fields_parentclass')[$i];
106
+            $form['fields'][$form_slug . '_' . $fields_slug[$i]]['placeholder'] = $request->get('fields_placeholder')[$i];
107
+            $form['fields'][$form_slug . '_' . $fields_slug[$i]]['validation'] = $request->get('fields_validation')[$i];
108
+            $form['fields'][$form_slug . '_' . $fields_slug[$i]]['value'] = $request->get('fields_value')[$i];
109 109
             $countFAN = count(explode(';', $request->get('fields_attributes_name')[$i]));
110 110
             for ($k = 0; $k < $countFAN; $k++) {
111
-                $form['fields'][$form_slug.'_'.$fields_slug[$i]]['attributes'][explode(';', $request->get('fields_attributes_name')[$i])[$k]] = explode(';', $request->get('fields_attributes_value')[$i])[$k];
111
+                $form['fields'][$form_slug . '_' . $fields_slug[$i]]['attributes'][explode(';', $request->get('fields_attributes_name')[$i])[$k]] = explode(';', $request->get('fields_attributes_value')[$i])[$k];
112 112
             }
113
-            $form['fields'][$form_slug.'_'.$fields_slug[$i]]['required'] = $request->get('fields_required')[$i];
113
+            $form['fields'][$form_slug . '_' . $fields_slug[$i]]['required'] = $request->get('fields_required')[$i];
114 114
         }
115 115
 
116 116
         $form['actions']['store'] = $request->get('action_store') == 'true' ? true : false;
Please login to merge, or discard this patch.
src/Controllers/Auth/RegisterController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
     protected function redirectTo()
40 40
     {
41
-        return '/'.Auth::user()->roles()->first()->redirect;
41
+        return '/' . Auth::user()->roles()->first()->redirect;
42 42
     }
43 43
 
44 44
     /**
Please login to merge, or discard this patch.
src/Controllers/Auth/LoginController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     protected function redirectTo()
38 38
     {
39
-        return '/'.Auth::user()->roles()->first()->redirect;
39
+        return '/' . Auth::user()->roles()->first()->redirect;
40 40
     }
41 41
 
42 42
     /**
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
     protected function validateLogin(\Illuminate\Http\Request $request)
58 58
     {
59 59
         $this->validate($request, [
60
-            $this->username() => 'required|exists:users,'.$this->username().',active,1',
60
+            $this->username() => 'required|exists:users,' . $this->username() . ',active,1',
61 61
             'password'        => 'required',
62 62
         ], [
63
-            $this->username().'.exists' => 'The selected email is invalid or the account is not active.',
63
+            $this->username() . '.exists' => 'The selected email is invalid or the account is not active.',
64 64
         ]);
65 65
     }
66 66
 }
Please login to merge, or discard this patch.
src/Controllers/ContentController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     {
126 126
         $repeater = Content::where('slug', $slug)->first();
127 127
 
128
-        $filename = $repeater->slug.'.json';
128
+        $filename = $repeater->slug . '.json';
129 129
         $handle = fopen($filename, 'w+');
130 130
         fputs($handle, $repeater->toJson(JSON_PRETTY_PRINT));
131 131
         fclose($handle);
@@ -144,18 +144,18 @@  discard block
 block discarded – undo
144 144
         $fields_slug = $request->get('fields_slug');
145 145
         $count = count($fields_slug);
146 146
         for ($i = 0; $i < $count; $i++) {
147
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['label'] = $request->get('fields_label')[$i];
148
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['type'] = $request->get('fields_type')[$i];
149
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['class'] = $request->get('fields_class')[$i];
150
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['placeholder'] = $request->get('fields_placeholder')[$i];
151
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['validation'] = $request->get('fields_validation')[$i];
152
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['value'] = $request->get('fields_value')[$i];
147
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['label'] = $request->get('fields_label')[$i];
148
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['type'] = $request->get('fields_type')[$i];
149
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['class'] = $request->get('fields_class')[$i];
150
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['placeholder'] = $request->get('fields_placeholder')[$i];
151
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['validation'] = $request->get('fields_validation')[$i];
152
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['value'] = $request->get('fields_value')[$i];
153 153
             $fieldsCount = count(explode(';', $request->get('fields_attributes_name')[$i]));
154 154
             for ($k = 0; $k < $fieldsCount; $k++) {
155
-                $content['fields'][$content_slug.'_'.$fields_slug[$i]]['attributes'][explode(';', $request->get('fields_attributes_name')[$i])[$k]] = explode(';', $request->get('fields_attributes_value')[$i])[$k];
155
+                $content['fields'][$content_slug . '_' . $fields_slug[$i]]['attributes'][explode(';', $request->get('fields_attributes_name')[$i])[$k]] = explode(';', $request->get('fields_attributes_value')[$i])[$k];
156 156
             }
157
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['required'] = $request->get('fields_required')[$i];
158
-            $content['fields'][$content_slug.'_'.$fields_slug[$i]]['table'] = $request->get('fields_table')[$i];
157
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['required'] = $request->get('fields_required')[$i];
158
+            $content['fields'][$content_slug . '_' . $fields_slug[$i]]['table'] = $request->get('fields_table')[$i];
159 159
         }
160 160
 
161 161
         $content['actions']['store'] = $request->get('action_store');
Please login to merge, or discard this patch.