Passed
Branch main (ad992b)
by Sammy
02:35
created
Controllers/DisplayController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
         $this->viewport('user_messages', $this->logger()->getUserReport());
50 50
 
51 51
         $this->viewport('web_root', $this->router()->webRoot());
52
-        $this->viewport('view_path', $this->router()->filePath() . $this->get('settings.smarty.template_path') . 'app/');
53
-        $this->viewport('view_url', $this->router()->webRoot() . $this->get('settings.smarty.template_path'));
54
-        $this->viewport('images_url', $this->router()->webRoot() . $this->get('settings.smarty.template_path') . 'images/');
52
+        $this->viewport('view_path', $this->router()->filePath().$this->get('settings.smarty.template_path').'app/');
53
+        $this->viewport('view_url', $this->router()->webRoot().$this->get('settings.smarty.template_path'));
54
+        $this->viewport('images_url', $this->router()->webRoot().$this->get('settings.smarty.template_path').'images/');
55 55
 
56 56
         foreach ($this->viewport() as $template_var_name => $value) {
57 57
             $smarty->assign($template_var_name, $value);
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
           // 1. check for custom template in the current controller directory
82 82
             $templates ['custom_3'] = sprintf('%s/%s.html', $controller_template_path, $custom_template);
83 83
           // 2. check for custom template formatted as controller/view
84
-            $templates ['custom_2'] = $custom_template . '.html';
85
-            $templates ['custom_1'] = '_layouts/' . $custom_template . '.html';
84
+            $templates ['custom_2'] = $custom_template.'.html';
85
+            $templates ['custom_1'] = '_layouts/'.$custom_template.'.html';
86 86
         }
87 87
 
88 88
         if (!empty($this->router()->targetMethod())) {
Please login to merge, or discard this patch.
Controllers/ORMController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $ret = $this->modelType();
58 58
 
59 59
         if (!is_null($suffix)) {
60
-            $ret .= '_' . $suffix;
60
+            $ret .= '_'.$suffix;
61 61
         }
62 62
 
63 63
         return $ret;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     {
108 108
         if (is_null($this->model_class_name)) {
109 109
             preg_match(LeMarchand::RX_CLASS_NAME, get_called_class(), $m);
110
-            $this->model_class_name = $this->get($m[1] . 'Class');
110
+            $this->model_class_name = $this->get($m[1].'Class');
111 111
         }
112 112
 
113 113
         return $this->model_class_name;
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
         $this->viewport('listing_fields', $listing_fields);
176 176
         $this->viewport('listing_template', $listing_template);
177 177
 
178
-        $this->viewport('route_new', $this->router()->hyp($class_name::model_type() . '_new'));
179
-        $this->viewport('route_export', $this->router()->hyp($class_name::model_type() . '_export'));
178
+        $this->viewport('route_new', $this->router()->hyp($class_name::model_type().'_new'));
179
+        $this->viewport('route_export', $this->router()->hyp($class_name::model_type().'_export'));
180 180
     }
181 181
 
182 182
     public function copy()
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     {
208 208
         $this->errors = $model->save($this->operator()->operator_id()); // returns [errors]
209 209
         if (empty($this->errors())) {
210
-            $this->logger()->nice($this->l('CRUDITES_INSTANCE_ALTERED', [$this->l('MODEL_' . get_class($model)::model_type() . '_INSTANCE')]));
210
+            $this->logger()->nice($this->l('CRUDITES_INSTANCE_ALTERED', [$this->l('MODEL_'.get_class($model)::model_type().'_INSTANCE')]));
211 211
             return $model;
212 212
         }
213 213
         foreach ($this->errors() as $field => $error_msg) {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     public function before_edit()
221 221
     {
222 222
         if (!is_null($this->router()->params('id')) && is_null($this->load_model)) {
223
-            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->modelClassName()::model_type() . '_INSTANCE')]));
223
+            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->modelClassName()::model_type().'_INSTANCE')]));
224 224
             $this->router()->hop($this->modelClassName()::model_type());
225 225
         }
226 226
     }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     public function destroy_confirm()
240 240
     {
241 241
         if (is_null($this->load_model)) {
242
-            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')]));
242
+            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')]));
243 243
             $this->router()->hop($this->model_type);
244 244
         }
245 245
 
@@ -251,10 +251,10 @@  discard block
 block discarded – undo
251 251
     public function before_destroy() // default: checks for load_model and immortality, hops back to object on failure
252 252
     {
253 253
         if (is_null($this->load_model)) {
254
-            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')]));
254
+            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')]));
255 255
             $this->router()->hop($this->model_type);
256 256
         } elseif ($this->load_model->immortal()) {
257
-            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_IS_IMMORTAL', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')]));
257
+            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_IS_IMMORTAL', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')]));
258 258
             $this->router()->hop($this->route_model($this->load_model));
259 259
         }
260 260
     }
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
         }
267 267
 
268 268
         if ($this->load_model->destroy($this->operator()->operator_id()) === false) {
269
-            $this->logger()->info($this->l('CRUDITES_ERR_INSTANCE_IS_UNDELETABLE', ['' . $this->load_model]));
269
+            $this->logger()->info($this->l('CRUDITES_ERR_INSTANCE_IS_UNDELETABLE', [''.$this->load_model]));
270 270
             $this->route_back($this->load_model);
271 271
         } else {
272
-            $this->logger()->nice($this->l('CRUDITES_INSTANCE_DESTROYED', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')]));
272
+            $this->logger()->nice($this->l('CRUDITES_INSTANCE_DESTROYED', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')]));
273 273
             $this->route_back($this->model_type);
274 274
         }
275 275
     }
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     public function collection_to_csv($collection, $filename)
294 294
     {
295 295
       // TODO use Format/File/CSV class to generate file
296
-        $file_path = $this->get('settings.export.directory') . $filename . '.csv';
296
+        $file_path = $this->get('settings.export.directory').$filename.'.csv';
297 297
         $fp = fopen($file_path, 'w');
298 298
 
299 299
         $header = false;
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
     public function route_new(ModelInterface $model): string
332 332
     {
333
-        return $this->router()->hyp(get_class($model)::model_type() . '_new');
333
+        return $this->router()->hyp(get_class($model)::model_type().'_new');
334 334
     }
335 335
 
336 336
     public function route_list(ModelInterface $model): string
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
     {
343 343
         $route_params = [];
344 344
 
345
-        $route_name = get_class($model)::model_type() . '_';
345
+        $route_name = get_class($model)::model_type().'_';
346 346
         if ($model->is_new()) {
347 347
             $route_name .= 'new';
348 348
         } else {
Please login to merge, or discard this patch.