Completed
Push — master ( 308a3c...ebb499 )
by Alexey
08:08
created
system/modules/Exchange1c/install_script.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function($step = NULL, $params = []) {
4 4
 
5 5
     $groups = [
6 6
         [
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function ($step = null, $params = []) {
4 4
     \App::$cur->db->createTable('exchange1c_exchange', [
5 5
         'exchange_id' => 'pk',
6 6
         'exchange_type' => 'varchar(255) NOT NULL',
Please login to merge, or discard this patch.
system/modules/Materials/install_script.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function($step = NULL, $params = []) {
4 4
 
5 5
     $groups = [
6 6
         [
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function ($step = null, $params = []) {
4 4
     $material = new Materials\Material([
5 5
         'name' => 'Главная',
6 6
         'text' => '<p>Главная страница сайта</p>',
Please login to merge, or discard this patch.
system/modules/Sliders/install_script.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function($step = NULL, $params = []) {
4 4
 
5 5
     $groups = [
6 6
         [
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function ($step = null, $params = []) {
4 4
     
5 5
 };
Please login to merge, or discard this patch.
system/modules/TextBlocks/install_script.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function($step = NULL, $params = []) {
4 4
 
5 5
     $groups = [
6 6
         [
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function ($step = null, $params = []) {
4 4
     App::$cur->db->createTable('textblocks_block', [
5 5
         'block_id' => 'pk',
6 6
         'block_code' => 'varchar(255) NOT NULL',
Please login to merge, or discard this patch.
system/modules/UserForms/install_script.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function($step = NULL, $params = []) {
4 4
 
5 5
     $groups = [
6 6
         [
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function ($step = null, $params = []) {
4 4
     
5 5
 };
Please login to merge, or discard this patch.
system/modules/Users/models/User/Inventory.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -97,13 +97,13 @@
 block discarded – undo
97 97
         if ($this->first_name . $this->last_name . $this->middle_name) {
98 98
             $name = '';
99 99
             if ($this->first_name) {
100
-                $name.=$this->first_name;
100
+                $name .= $this->first_name;
101 101
             }
102 102
             if ($this->middle_name) {
103
-                $name.=($name ? ' ' : '') . $this->middle_name;
103
+                $name .= ($name ? ' ' : '') . $this->middle_name;
104 104
             }
105 105
             if ($this->last_name) {
106
-                $name.=($name ? ' ' : '') . $this->last_name;
106
+                $name .= ($name ? ' ' : '') . $this->last_name;
107 107
             }
108 108
             return $name;
109 109
         } else {
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,8 @@
 block discarded – undo
56 56
                 $name.=($name ? ' ' : '') . $this->last_name;
57 57
             }
58 58
             return $name;
59
-        } else {
59
+        }
60
+        else {
60 61
             return $this->user_id;
61 62
         }
62 63
     }
Please login to merge, or discard this patch.
system/modules/Ui/objects/DataManager.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -329,6 +329,9 @@
 block discarded – undo
329 329
         return $rows;
330 330
     }
331 331
 
332
+    /**
333
+     * @param DataManager $dataManager
334
+     */
332 335
     public static function drawCol($item, $colName, $params = [], $dataManager = null, $originalCol = '', $originalItem = null)
333 336
     {
334 337
         $modelName = get_class($item);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
                         return $item->$colName;
474 474
                 }
475 475
             } elseif (!empty($modelName::$cols[$colName]['type'])) {
476
-                if (\App::$cur->name == 'admin' && $originalCol == 'name' || ( $dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) {
476
+                if (\App::$cur->name == 'admin' && $originalCol == 'name' || ($dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) {
477 477
                     $formName = $dataManager && !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager';
478 478
                     $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem));
479 479
                     return "<a href ='/admin/{$originalItem->genViewLink()}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>";
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
             ];
685 685
         }
686 686
         $tableCols[] = '';
687
-        $this->table->class .=' datamanagertable';
687
+        $this->table->class .= ' datamanagertable';
688 688
         $this->table->setCols($tableCols);
689 689
     }
690 690
 
Please login to merge, or discard this patch.
Braces   +46 added lines, -23 removed lines patch added patch discarded remove patch
@@ -42,10 +42,12 @@  discard block
 block discarded – undo
42 42
             $this->managerOptions = !empty($modelNameOrOptions::$dataManagers[$managerName]) ? $modelNameOrOptions::$dataManagers[$managerName] : [];
43 43
             if (isset($modelNameOrOptions::$objectName)) {
44 44
                 $this->name = $modelNameOrOptions::$objectName;
45
-            } else {
45
+            }
46
+            else {
46 47
                 $this->name = $modelNameOrOptions;
47 48
             }
48
-        } else {
49
+        }
50
+        else {
49 51
             $this->managerOptions = $modelNameOrOptions;
50 52
         }
51 53
 
@@ -152,7 +154,8 @@  discard block
 block discarded – undo
152 154
                     $action['className'] = $key;
153 155
                 }
154 156
                 $return[$key] = $action;
155
-            } else {
157
+            }
158
+            else {
156 159
                 $key = $action;
157 160
                 $return[$key] = [
158 161
                     'className' => $action
@@ -208,7 +211,8 @@  discard block
 block discarded – undo
208 211
             if (is_array($col)) {
209 212
                 $colName = $key;
210 213
                 $colOptions = $col;
211
-            } else {
214
+            }
215
+            else {
212 216
                 $colName = $col;
213 217
                 $colOptions = [];
214 218
             }
@@ -218,7 +222,8 @@  discard block
 block discarded – undo
218 222
             }
219 223
             if (empty($colOptions['label']) && !empty($colInfo['label'])) {
220 224
                 $colOptions['label'] = $colInfo['label'];
221
-            } elseif (empty($colOptions['label'])) {
225
+            }
226
+            elseif (empty($colOptions['label'])) {
222 227
                 $colOptions['label'] = $colName;
223 228
             }
224 229
             $cols[$colName] = $colOptions;
@@ -267,7 +272,8 @@  discard block
 block discarded – undo
267 272
             foreach ($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'] as $colName => $colOptions) {
268 273
                 if (!empty($colOptions['userCol'])) {
269 274
                     $queryParams['where'][] = [$colName, \Model::getColValue(\Users\User::$cur, $colOptions['userCol'])];
270
-                } elseif (isset($colOptions['value'])) {
275
+                }
276
+                elseif (isset($colOptions['value'])) {
271 277
                     if (is_array($colOptions['value'])) {
272 278
                         foreach ($colOptions['value'] as $key => $value) {
273 279
                             if ($key === 'userCol') {
@@ -318,7 +324,8 @@  discard block
 block discarded – undo
318 324
                             if ($colInfo['colParams']['type'] == 'dateTime' && !strpos($params['filters'][$col]['max'], ' ')) {
319 325
 
320 326
                                 $date = $params['filters'][$col]['max'] . ' 23:59:59';
321
-                            } else {
327
+                            }
328
+                            else {
322 329
                                 $date = $params['filters'][$col]['max'];
323 330
                             }
324 331
                             $queryParams['where'][] = [$col, $date, '<='];
@@ -362,7 +369,8 @@  discard block
 block discarded – undo
362 369
         }
363 370
         if (!empty($params['mode']) && $params['mode'] == 'sort') {
364 371
             $queryParams['order'] = ['weight', 'asc'];
365
-        } elseif (!empty($params['sortered']) && !empty($this->managerOptions['sortable'])) {
372
+        }
373
+        elseif (!empty($params['sortered']) && !empty($this->managerOptions['sortable'])) {
366 374
             foreach ($params['sortered'] as $colName => $sortType) {
367 375
                 if ($colName && in_array($colName, $this->managerOptions['sortable'])) {
368 376
                     $sortType = in_array($sortType, ['desc', 'asc']) ? $sortType : 'desc';
@@ -373,7 +381,8 @@  discard block
 block discarded – undo
373 381
         if ($model && !empty($params['relation'])) {
374 382
             $relation = $model::getRelation($params['relation']);
375 383
             $items = $model->$params['relation']($queryParams);
376
-        } else {
384
+        }
385
+        else {
377 386
             $relation = false;
378 387
             $items = $modelName::getList($queryParams);
379 388
         }
@@ -389,7 +398,8 @@  discard block
 block discarded – undo
389 398
             foreach ($this->managerOptions['cols'] as $key => $colName) {
390 399
                 if (!empty($params['download'])) {
391 400
                     $row[] = \Model::getColValue($item, is_array($colName) ? $key : $colName, true, false);
392
-                } else {
401
+                }
402
+                else {
393 403
                     $row[] = DataManager::drawCol($item, is_array($colName) ? $key : $colName, $params, $this);
394 404
                 }
395 405
             }
@@ -418,7 +428,8 @@  discard block
 block discarded – undo
418 428
             $col = substr($colName, strpos($colName, ':') + 1);
419 429
             if ($item->$rel) {
420 430
                 return DataManager::drawCol($item->$rel, $col, $params, $dataManager, $originalCol, $originalItem);
421
-            } else {
431
+            }
432
+            else {
422 433
                 return 'Не указано';
423 434
             }
424 435
         }
@@ -441,20 +452,24 @@  discard block
 block discarded – undo
441 452
                             $href = "<a href ='/admin/" . $item->{$modelName::$cols[$colName]['relation']}->genViewLink() . "'>";
442 453
                             if (!empty($modelName::$cols[$colName]['showCol'])) {
443 454
                                 $href .= $item->{$modelName::$cols[$colName]['relation']}->{$modelName::$cols[$colName]['showCol']};
444
-                            } else {
455
+                            }
456
+                            else {
445 457
 
446 458
                                 $href .= $item->{$modelName::$cols[$colName]['relation']}->name();
447 459
                             }
448 460
                             $href .= '</a>';
449 461
                             return $href;
450
-                        } else {
462
+                        }
463
+                        else {
451 464
                             return $item->{$modelName::$cols[$colName]['relation']}->name();
452 465
                         }
453
-                    } else {
466
+                    }
467
+                    else {
454 468
                         return $item->$colName;
455 469
                     }
456 470
             }
457
-        } else {
471
+        }
472
+        else {
458 473
             if (!empty($modelName::$cols[$colName]['view']['type'])) {
459 474
                 switch ($modelName::$cols[$colName]['view']['type']) {
460 475
                     case 'widget':
@@ -472,15 +487,18 @@  discard block
 block discarded – undo
472 487
                     default:
473 488
                         return $item->$colName;
474 489
                 }
475
-            } elseif (!empty($modelName::$cols[$colName]['type'])) {
490
+            }
491
+            elseif (!empty($modelName::$cols[$colName]['type'])) {
476 492
                 if (\App::$cur->name == 'admin' && $originalCol == 'name' || ( $dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) {
477 493
                     $formName = $dataManager && !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager';
478 494
                     $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem));
479 495
                     return "<a href ='/admin/{$originalItem->genViewLink()}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>";
480
-                } elseif (\App::$cur->name == 'admin' && $colName == 'name') {
496
+                }
497
+                elseif (\App::$cur->name == 'admin' && $colName == 'name') {
481 498
                     $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem));
482 499
                     return "<a href ='/admin/{$item->genViewLink()}?redirectUrl={$redirectUrl}'>{$item->$colName}</a>";
483
-                } elseif ($modelName::$cols[$colName]['type'] == 'html') {
500
+                }
501
+                elseif ($modelName::$cols[$colName]['type'] == 'html') {
484 502
                     $uid = \Tools::randomString();
485 503
                     $script = "<script>inji.onLoad(function(){
486 504
             var el{$uid}=$('#{$uid}');
@@ -509,10 +527,12 @@  discard block
 block discarded – undo
509 527
             }
510 528
             })</script>";
511 529
                     return "<div id = '{$uid}' style='max-height:44px;overflow:hidden;'>{$item->$colName}</div>" . $script;
512
-                } else {
530
+                }
531
+                else {
513 532
                     return \Model::resloveTypeValue($item, $colName);
514 533
                 }
515
-            } else {
534
+            }
535
+            else {
516 536
                 return $item->$colName;
517 537
             }
518 538
         }
@@ -561,7 +581,8 @@  discard block
 block discarded – undo
561 581
             foreach ($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'] as $colName => $colOptions) {
562 582
                 if (!empty($colOptions['userCol'])) {
563 583
                     $queryParams['where'][] = [$colName, \Model::getColValue(\Users\User::$cur, $colOptions['userCol'])];
564
-                } elseif (isset($colOptions['value'])) {
584
+                }
585
+                elseif (isset($colOptions['value'])) {
565 586
                     if (is_array($colOptions['value'])) {
566 587
                         foreach ($colOptions['value'] as $key => $value) {
567 588
                             if ($key === 'userCol') {
@@ -613,7 +634,8 @@  discard block
 block discarded – undo
613 634
                             if ($colInfo['colParams']['type'] == 'dateTime' && !strpos($params['filters'][$col]['max'], ' ')) {
614 635
 
615 636
                                 $date = $params['filters'][$col]['max'] . ' 23:59:59';
616
-                            } else {
637
+                            }
638
+                            else {
617 639
                                 $date = $params['filters'][$col]['max'];
618 640
                             }
619 641
                             $queryParams['where'][] = [$col, $date, '<='];
@@ -657,7 +679,8 @@  discard block
 block discarded – undo
657 679
         }
658 680
         if ($model && !empty($params['relation'])) {
659 681
             $count = $model->$params['relation']($queryParams);
660
-        } else {
682
+        }
683
+        else {
661 684
             $count = $modelName::getCount($queryParams);
662 685
         }
663 686
         $pages = new Pages([
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/UserAdds/Field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             'map' => [
45 45
                 ['name', 'type'],
46 46
                 ['required', 'save'],
47
-                [ 'userfield']
47
+                ['userfield']
48 48
             ]
49 49
         ]
50 50
     ];
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Delivery/Field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             'map' => [
45 45
                 ['name', 'type'],
46 46
                 ['required', 'save'],
47
-                [ 'userfield']
47
+                ['userfield']
48 48
             ]
49 49
         ]
50 50
     ];
Please login to merge, or discard this patch.