Passed
Branch main (08d999)
by Sammy
03:02
created
Controllers/TradukoController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     public function update_file($lang = 'fra')
23 23
     {
24 24
         try {
25
-            $locale_path = $this->box('settings.locale.directory_path') . '/' . $this->box('settings.locale.file_name');
25
+            $locale_path = $this->box('settings.locale.directory_path').'/'.$this->box('settings.locale.file_name');
26 26
             self::create_file($locale_path, $lang);
27 27
 
28 28
             $this->logger()->nice($this->l('KADRO_SYSTEM_FILE_UPDATED'));
Please login to merge, or discard this patch.
Models/Abilities/Event.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 
23 23
     public function event_label()
24 24
     {
25
-        return '' . $this;
25
+        return ''.$this;
26 26
     }
27 27
 
28 28
     public static function today($format = Dato::FORMAT)
Please login to merge, or discard this patch.
Auth/Operatorability.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@
 block discarded – undo
49 49
 
50 50
     public static function enhance_query_retrieve($Query, $filters, $options)
51 51
     {
52
-        $Query->auto_join([ACL::table(),'ACL'], null, 'LEFT OUTER');
52
+        $Query->auto_join([ACL::table(), 'ACL'], null, 'LEFT OUTER');
53 53
         $permission_alias = $Query->auto_join([Permission::table(), 'permission'], null, 'LEFT OUTER');
54 54
 
55 55
         $permission_ids_and_names = [];
56
-        $permission_ids_and_names [] = sprintf('GROUP_CONCAT(DISTINCT %s.%s) as %s', $permission_alias, 'id', $permission_alias . '_ids');
57
-        $permission_ids_and_names [] = sprintf('GROUP_CONCAT(DISTINCT %s.%s) as %s', $permission_alias, 'name', $permission_alias . '_names');
56
+        $permission_ids_and_names [] = sprintf('GROUP_CONCAT(DISTINCT %s.%s) as %s', $permission_alias, 'id', $permission_alias.'_ids');
57
+        $permission_ids_and_names [] = sprintf('GROUP_CONCAT(DISTINCT %s.%s) as %s', $permission_alias, 'name', $permission_alias.'_names');
58 58
         $Query->select_also($permission_ids_and_names);
59 59
 
60 60
         $Query->select_also(['operator.name as operator_name', 'operator.active as operator_active']);
Please login to merge, or discard this patch.
kadro.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
         $file_name = self::$box->get('settings.locale.file_name');
41 41
         $fallback_lang = self::$box->get('settings.locale.fallback_lang');
42 42
 
43
-        $lezer = new Lezer($locale_path . '/' . $file_name, $locale_path . '/cache', $fallback_lang);
43
+        $lezer = new Lezer($locale_path.'/'.$file_name, $locale_path.'/cache', $fallback_lang);
44 44
         $language = $lezer->availableLanguage();
45 45
         $lezer->init();
46 46
 
47 47
         self::$box->get('template_engine')->assign('lezer', $lezer);
48 48
         self::$box->get('template_engine')->assign('language', $language);
49 49
 
50
-        setcookie('lang', $language, time() + (365 * 24 * 60 * 60), "/", "");
50
+        setcookie('lang', $language, time()+(365 * 24 * 60 * 60), "/", "");
51 51
 
52 52
         return self::$box;
53 53
     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $setting = 'settings.default.charset';
129 129
         if (is_string(self::$box->get($setting))) {
130 130
             ini_set('default_charset', self::$box->get($setting));
131
-            header('Content-type: text/html; charset=' . strtolower(self::$box->get($setting)));
131
+            header('Content-type: text/html; charset='.strtolower(self::$box->get($setting)));
132 132
         } else {
133 133
             throw new \UnexpectedValueException($setting);
134 134
         }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         // ----     parametroj:linguo
137 137
         $setting = 'settings.default.language';
138 138
         if (is_string(self::$box->get($setting))) {
139
-            putenv('LANG=' . self::$box->get($setting));
139
+            putenv('LANG='.self::$box->get($setting));
140 140
             setlocale(LC_ALL, self::$box->get($setting));
141 141
         } else {
142 142
             throw new \UnexpectedValueException($setting);
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         foreach (self::$box->get('settings.smarty.template_extra_directories') as $i => $template_dir) {
163 163
             $smarty->addTemplateDir($template_dir);
164 164
         }
165
-        $smarty->addTemplateDir(__DIR__ . '/Views/'); //kadro templates
165
+        $smarty->addTemplateDir(__DIR__.'/Views/'); //kadro templates
166 166
 
167 167
         $setting = 'settings.smarty.compiled_path';
168 168
         if (is_string(self::$box->get($setting))) {
Please login to merge, or discard this patch.
Controllers/ORMController.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function formModel(ModelInterface $setter = null): ModelInterface
34 34
     {
35
-      if(!is_null($setter)){
35
+      if (!is_null($setter)) {
36 36
         $this->form_model = $setter;
37 37
       }
38
-      elseif(is_null($this->form_model)){
38
+      elseif (is_null($this->form_model)) {
39 39
         $reflection = new \ReflectionClass($this->modelClassName());
40 40
         $this->form_model = $reflection->newInstanceWithoutConstructor(); //That's it!
41 41
       }
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
     public function modelType(): string
47 47
     {
48 48
       // have to go through the model to garantee model_type existence via interface
49
-      if(is_null($this->model_type))
49
+      if (is_null($this->model_type))
50 50
         $this->model_type = get_class($this->formModel())::model_type();
51 51
 
52 52
       return $this->model_type;
53 53
     }
54 54
 
55
-    public function modelPrefix($suffix=null): string
55
+    public function modelPrefix($suffix = null): string
56 56
     {
57 57
       $ret = $this->modelType();
58 58
 
59
-      if(!is_null($suffix))
59
+      if (!is_null($suffix))
60 60
         $ret .= '_'.$suffix;
61 61
 
62 62
       return $ret;
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
         $this->viewport('listing_fields', $listing_fields);
175 175
         $this->viewport('listing_template', $listing_template);
176 176
 
177
-        $this->viewport('route_new', $this->router()->prehop($class_name::model_type() . '_new'));
178
-        $this->viewport('route_export', $this->router()->prehop($class_name::model_type() . '_export'));
177
+        $this->viewport('route_new', $this->router()->prehop($class_name::model_type().'_new'));
178
+        $this->viewport('route_export', $this->router()->prehop($class_name::model_type().'_export'));
179 179
     }
180 180
 
181 181
     public function copy()
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     {
207 207
         $this->errors = $model->save($this->operator()->operator_id()); // returns [errors]
208 208
         if (empty($this->errors())) {
209
-            $this->logger()->nice($this->l('CRUDITES_INSTANCE_ALTERED', [$this->l('MODEL_' . get_class($model)::model_type() . '_INSTANCE')]));
209
+            $this->logger()->nice($this->l('CRUDITES_INSTANCE_ALTERED', [$this->l('MODEL_'.get_class($model)::model_type().'_INSTANCE')]));
210 210
             return $model;
211 211
         }
212 212
         foreach ($this->errors() as $field => $error_msg) {
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     public function before_edit()
220 220
     {
221 221
         if (!is_null($this->router()->params('id')) && is_null($this->load_model)) {
222
-            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->modelClassName()::model_type() . '_INSTANCE')]));
222
+            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->modelClassName()::model_type().'_INSTANCE')]));
223 223
             $this->router()->hop($this->modelClassName()::model_type());
224 224
         }
225 225
     }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
     public function destroy_confirm()
239 239
     {
240 240
         if (is_null($this->load_model)) {
241
-            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')]));
241
+            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')]));
242 242
             $this->router()->hop($this->model_type);
243 243
         }
244 244
 
@@ -250,10 +250,10 @@  discard block
 block discarded – undo
250 250
     public function before_destroy() // default: checks for load_model and immortality, hops back to object on failure
251 251
     {
252 252
         if (is_null($this->load_model)) {
253
-            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')]));
253
+            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')]));
254 254
             $this->router()->hop($this->model_type);
255 255
         } elseif ($this->load_model->immortal()) {
256
-            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_IS_IMMORTAL', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')]));
256
+            $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_IS_IMMORTAL', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')]));
257 257
             $this->router()->hop($this->route_model($this->load_model));
258 258
         }
259 259
     }
@@ -265,10 +265,10 @@  discard block
 block discarded – undo
265 265
         }
266 266
 
267 267
         if ($this->load_model->destroy($this->operator()->operator_id()) === false) {
268
-            $this->logger()->info($this->l('CRUDITES_ERR_INSTANCE_IS_UNDELETABLE', ['' . $this->load_model]));
268
+            $this->logger()->info($this->l('CRUDITES_ERR_INSTANCE_IS_UNDELETABLE', [''.$this->load_model]));
269 269
             $this->route_back($this->load_model);
270 270
         } else {
271
-            $this->logger()->nice($this->l('CRUDITES_INSTANCE_DESTROYED', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')]));
271
+            $this->logger()->nice($this->l('CRUDITES_INSTANCE_DESTROYED', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')]));
272 272
             $this->route_back($this->model_type);
273 273
         }
274 274
     }
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
     public function collection_to_csv($collection, $filename)
295 295
     {
296 296
       // TODO use Format/File/CSV class to generate file
297
-        $file_path = $this->box('settings.export.directory') . $filename . '.csv';
297
+        $file_path = $this->box('settings.export.directory').$filename.'.csv';
298 298
         $fp = fopen($file_path, 'w');
299 299
 
300 300
         $header = false;
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 
332 332
     public function route_new(ModelInterface $model): string
333 333
     {
334
-        return $this->router()->prehop(get_class($model)::model_type() . '_new');
334
+        return $this->router()->prehop(get_class($model)::model_type().'_new');
335 335
     }
336 336
 
337 337
     public function route_list(ModelInterface $model): string
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
     {
344 344
         $route_params = [];
345 345
 
346
-        $route_name = get_class($model)::model_type() . '_';
346
+        $route_name = get_class($model)::model_type().'_';
347 347
         if ($model->is_new()) {
348 348
             $route_name .= 'new';
349 349
         } else {
Please login to merge, or discard this patch.
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
       if(!is_null($setter)){
36 36
         $this->form_model = $setter;
37
-      }
38
-      elseif(is_null($this->form_model)){
37
+      } elseif(is_null($this->form_model)){
39 38
         $reflection = new \ReflectionClass($this->modelClassName());
40 39
         $this->form_model = $reflection->newInstanceWithoutConstructor(); //That's it!
41 40
       }
@@ -46,8 +45,9 @@  discard block
 block discarded – undo
46 45
     public function modelType(): string
47 46
     {
48 47
       // have to go through the model to garantee model_type existence via interface
49
-      if(is_null($this->model_type))
50
-        $this->model_type = get_class($this->formModel())::model_type();
48
+      if(is_null($this->model_type)) {
49
+              $this->model_type = get_class($this->formModel())::model_type();
50
+      }
51 51
 
52 52
       return $this->model_type;
53 53
     }
@@ -56,8 +56,9 @@  discard block
 block discarded – undo
56 56
     {
57 57
       $ret = $this->modelType();
58 58
 
59
-      if(!is_null($suffix))
60
-        $ret .= '_'.$suffix;
59
+      if(!is_null($suffix)) {
60
+              $ret .= '_'.$suffix;
61
+      }
61 62
 
62 63
       return $ret;
63 64
     }
Please login to merge, or discard this patch.