Completed
Branch master (ebb499)
by Alexey
04:15
created
system/modules/Migrations/appAdminControllers/MapController.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
                 if (is_numeric($objectType)) {
20 20
                     $mapPath->object_id = $objectType;
21 21
                     $mapPath->type = 'object';
22
-                } else {
22
+                }
23
+                else {
23 24
                     if ($objectType == 'object') {
24 25
                         $object = new Migrations\Migration\Object();
25 26
                         $object->model = !empty($_POST['typeOptions'][$pathId]) ? $_POST['typeOptions'][$pathId] : '';
@@ -28,7 +29,8 @@  discard block
 block discarded – undo
28 29
                         $object->save();
29 30
                         $mapPath->type = 'object';
30 31
                         $mapPath->object_id = $object->id;
31
-                    } else {
32
+                    }
33
+                    else {
32 34
                         $mapPath->type = $objectType;
33 35
                     }
34 36
                 }
@@ -48,7 +50,8 @@  discard block
 block discarded – undo
48 50
                     $object->save();
49 51
                     $param->type = 'object';
50 52
                     $param->value = $object->id;
51
-                } else {
53
+                }
54
+                else {
52 55
                     $param->type = $type;
53 56
                     $param->value = !empty($_POST['paramOptions'][$paramId]) ? $_POST['paramOptions'][$paramId] : '';
54 57
                 }
Please login to merge, or discard this patch.
system/modules/Migrations/objects/Parser/Object.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@  discard block
 block discarded – undo
28 28
                     $ids[] = $id;
29 29
                 }
30 30
             }
31
-        } else {
31
+        }
32
+        else {
32 33
             $id = $this->parseData($this->data, $preset);
33 34
             if ($id) {
34 35
                 $ids[] = $id;
@@ -56,10 +57,12 @@  discard block
 block discarded – undo
56 57
                         $parser->parentModel = $model;
57 58
                         $parser->walker = $this->walker;
58 59
                         $parser->parse();
59
-                    } else {
60
+                    }
61
+                    else {
60 62
                         if ($param->type == 'custom') {
61 63
                             $parserName = $param->value;
62
-                        } else {
64
+                        }
65
+                        else {
63 66
                             $parserName = '\Migrations\Parser\Object\\' . ucfirst($param->type);
64 67
                         }
65 68
                         $parser = new $parserName;
@@ -105,7 +108,8 @@  discard block
 block discarded – undo
105 108
             if ($param->type == 'item_key') {
106 109
                 $keyCol = $param->code;
107 110
                 break;
108
-            } elseif (!empty($options['unique'])) {
111
+            }
112
+            elseif (!empty($options['unique'])) {
109 113
                 $uniques[$param->code] = $param;
110 114
             }
111 115
         }
@@ -114,7 +118,8 @@  discard block
 block discarded – undo
114 118
             if ($objectId) {
115 119
                 $modelName = $this->object->model;
116 120
                 $model = $modelName::get($objectId->object_id);
117
-            } else {
121
+            }
122
+            else {
118 123
                 $model = new $this->object->model;
119 124
                 $model->save(['empty' => true]);
120 125
                 $objectId = new \Migrations\Id();
@@ -125,7 +130,8 @@  discard block
 block discarded – undo
125 130
                 \App::$cur->migrations->ids['objectIds'][$this->object->model][$model->id] = $objectId;
126 131
                 \App::$cur->migrations->ids['parseIds'][$this->object->model][(string) $data[$keyCol]] = $objectId;
127 132
             }
128
-        } elseif ($uniques) {
133
+        }
134
+        elseif ($uniques) {
129 135
             $where = [];
130 136
             foreach ($uniques as $code => $param) {
131 137
                 if (!isset($data[$code])) {
@@ -168,7 +174,8 @@  discard block
 block discarded – undo
168 174
                     if (!empty($relation['type']) && $relation['type'] == 'many') {
169 175
                         $where[] = [$relation['col'], $this->parentModel->pk()];
170 176
                     }
171
-                } elseif ($this->parentObject) {
177
+                }
178
+                elseif ($this->parentObject) {
172 179
                     $modelName = $this->parentObject->object->model;
173 180
                     $where[] = [$modelName::index(), $this->parentModel->pk()];
174 181
                 }
Please login to merge, or discard this patch.
system/modules/Migrations/objects/Parser/Object/ParamsList.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@  discard block
 block discarded – undo
23 23
             if ($this->model) {
24 24
                 if ($param->type == 'custom') {
25 25
                     $parserName = $param->value;
26
-                } else {
26
+                }
27
+                else {
27 28
                     $parserName = '\Migrations\Parser\Object\\' . ucfirst($param->type);
28 29
                 }
29 30
                 if (!\Tools::isAssoc($this->data)) {
@@ -35,7 +36,8 @@  discard block
 block discarded – undo
35 36
                         $parser->object = $this->object;
36 37
                         $parser->parse();
37 38
                     }
38
-                } else {
39
+                }
40
+                else {
39 41
                     $parser = new $parserName;
40 42
                     $parser->data = &$this->data[$param->code];
41 43
                     $parser->param = $param;
Please login to merge, or discard this patch.
system/modules/Migrations/objects/Parser/Object/Relation.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,8 @@  discard block
 block discarded – undo
52 52
                             }
53 53
                             $ids = array_merge($ids, $objectParser->parse([$relation['col'] => $this->model->pk()]));
54 54
                         }
55
-                    } else {
55
+                    }
56
+                    else {
56 57
                         $objectParser = new \Migrations\Parser\Object();
57 58
                         $objectParser->object = $object;
58 59
                         $objectParser->parentObject = $this->object;
@@ -85,7 +86,8 @@  discard block
 block discarded – undo
85 86
                     $delObject->delete();
86 87
                 }
87 88
             }
88
-        } else {
89
+        }
90
+        else {
89 91
             $objectParser = new \Migrations\Parser\Object();
90 92
             $objectParser->object = $object;
91 93
             $objectParser->parentObject = $this->object;
@@ -100,7 +102,8 @@  discard block
 block discarded – undo
100 102
                         $ids[] = $model->id;
101 103
                     }
102 104
                 }
103
-            } else {
105
+            }
106
+            else {
104 107
                 $model = $objectParser->setModel($this->data);
105 108
                 if ($model && $model->id) {
106 109
                     $ids[] = $model->id;
Please login to merge, or discard this patch.
system/modules/Migrations/objects/Parser/Object/Value.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,8 @@  discard block
 block discarded – undo
38 38
                                 $itemModel = get_class($item);
39 39
                                 $relation = $itemModel::getRelation($relationName);
40 40
                                 $sourceModel = $relation['model'];
41
-                            } else {
41
+                            }
42
+                            else {
42 43
                                 $relation = $modelName::getRelation($type['relation']);
43 44
                                 $sourceModel = $relation['model'];
44 45
                             }
@@ -49,10 +50,12 @@  discard block
 block discarded – undo
49 50
                         }
50 51
                         break;
51 52
                 }
52
-            } else {
53
+            }
54
+            else {
53 55
                 $type = $col['type'];
54 56
             }
55
-        } else {
57
+        }
58
+        else {
56 59
             $type = 'text';
57 60
         }
58 61
 
@@ -63,7 +66,8 @@  discard block
 block discarded – undo
63 66
                 $valueObject->param_id = $this->param->id;
64 67
                 $valueObject->original = $value;
65 68
                 $valueObject->save();
66
-            } else {
69
+            }
70
+            else {
67 71
                 $valueObject = $values[$value];
68 72
             }
69 73
             $value = $valueObject->replace;
Please login to merge, or discard this patch.
system/modules/Migrations/objects/Parser/Object/Param.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
             foreach ($this->data as &$data) {
23 23
                 $this->parseData($data, $params);
24 24
             }
25
-        } else {
25
+        }
26
+        else {
26 27
             $this->parseData($this->data, $params);
27 28
         }
28 29
     }
@@ -44,7 +45,8 @@  discard block
 block discarded – undo
44 45
                             $valueObject->param_id = $param->id;
45 46
                             $valueObject->original = (string) $objectParam;
46 47
                             $valueObject->save();
47
-                        } else {
48
+                        }
49
+                        else {
48 50
                             $objectParamValue['col'] = $col->replace;
49 51
                         }
50 52
                         break;
Please login to merge, or discard this patch.
system/modules/Migrations/objects/Walker.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@  discard block
 block discarded – undo
27 27
         //walk know pathes
28 28
         foreach ($this->map->paths(['where' => ['path', $this->curPath]]) as $path) {
29 29
             if (isset($this->data[$path->item])) {
30
-                if ($path->type == 'container') { //create walker for container
30
+                if ($path->type == 'container') {
31
+//create walker for container
31 32
                     $walker = new Walker();
32 33
                     $walker->migration = $this->migration;
33 34
                     $walker->map = $this->map;
@@ -37,7 +38,9 @@  discard block
 block discarded – undo
37 38
                     $walker->mapPathParent = $this->mapPath;
38 39
                     $walker->migtarionLog = $this->migtarionLog;
39 40
                     $walker->walk();
40
-                } elseif ($path->type == 'object') { //start parse path data
41
+                }
42
+                elseif ($path->type == 'object') {
43
+//start parse path data
41 44
                     $this->startObjectParse($path->object_id, $this->data[$path->item]);
42 45
                 }
43 46
             }
@@ -54,9 +57,12 @@  discard block
 block discarded – undo
54 57
                         ['code', $key],
55 58
                         ['migration_id', $this->migration->id]
56 59
             ]);
57
-            if ($object) { //parse as object
60
+            if ($object) {
61
+//parse as object
58 62
                 $this->startObjectParse($object, $data);
59
-            } else { //create new map path for configure unknown path
63
+            }
64
+            else {
65
+//create new map path for configure unknown path
60 66
                 $this->mapPath = new Migration\Map\Path();
61 67
                 $this->mapPath->parent_id = $this->mapPathParent ? $this->mapPathParent->id : 0;
62 68
                 $this->mapPath->path = $this->curPath;
@@ -79,7 +85,8 @@  discard block
 block discarded – undo
79 85
             $where = json_decode($objectParser->object->clear, true);
80 86
             if (!$where) {
81 87
                 $where = [];
82
-            } else {
88
+            }
89
+            else {
83 90
                 $where = [[$where]];
84 91
             }
85 92
             if ($ids) {
Please login to merge, or discard this patch.
system/modules/Exchange1c/objects/Parser/Orders.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,7 +47,8 @@  discard block
 block discarded – undo
47 47
                 $payed = true;
48 48
                 $date = new \DateTime((string) $reqs['Дата оплаты по 1С']);
49 49
                 $cart->payed_date = $date->format('Y-m-d H:i:s');
50
-            } elseif (
50
+            }
51
+            elseif (
51 52
                     (!empty($reqs['Отменен']) && $reqs['Отменен'] == 'true') ||
52 53
                     (!empty($reqs['Дата оплаты по 1С']) && $reqs['Дата оплаты по 1С'] == 'T')) {
53 54
                 $cancel = true;
@@ -57,10 +58,12 @@  discard block
 block discarded – undo
57 58
             $cart->payed = $payed;
58 59
             if ($payed && $cart->cart_status_id == 5) {
59 60
                 
60
-            } elseif ($payed && $cart->cart_status_id == 3) {
61
+            }
62
+            elseif ($payed && $cart->cart_status_id == 3) {
61 63
                 $cart->cart_status_id = 5;
62 64
                 $cart->save();
63
-            } elseif ($cancel && $cart->cart_status_id == 3) {
65
+            }
66
+            elseif ($cancel && $cart->cart_status_id == 3) {
64 67
                 $cart->cart_status_id = 4;
65 68
             }
66 69
             if ($cart->warehouse_block && !$payed && !$cancel && !empty($reqs['Проведен']) && $reqs['Проведен'] == 'true') {
@@ -104,7 +107,8 @@  discard block
 block discarded – undo
104 107
             $itemPrice = number_format((string) $item->ЦенаЗаЕдиницу, 2, '.', '');
105 108
             if (!empty($pricesByPrice[$itemPrice])) {
106 109
                 $price = $pricesByPrice[$itemPrice];
107
-            } else {
110
+            }
111
+            else {
108 112
                 $rolePrice = 0;
109 113
                 foreach ($siteItem->prices as $priceId => $itemPrice) {
110 114
                     if (!$itemPrice->type->cipt_roles) {
Please login to merge, or discard this patch.
system/modules/Exchange1c/objects/Parser/Item/Images.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@  discard block
 block discarded – undo
39 39
                 $md5File = '';
40 40
                 if ($file->md5) {
41 41
                     $md5File = $file->md5;
42
-                } elseif (file_exists($file->getRealPath())) {
42
+                }
43
+                elseif (file_exists($file->getRealPath())) {
43 44
                     $md5File = $file->md5 = md5_file($file->getRealPath());
44 45
                     $file->save();
45 46
                 }
@@ -60,7 +61,8 @@  discard block
 block discarded – undo
60 61
                     $image->save();
61 62
                     $ids[] = $image->id;
62 63
                 }
63
-            } else {
64
+            }
65
+            else {
64 66
                 $image->weight = $key;
65 67
             }
66 68
             if ($image && !$this->model->image_file_id) {
Please login to merge, or discard this patch.