Completed
Push — master ( 308a3c...ebb499 )
by Alexey
08:08
created
system/modules/UserForms/models/Form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@
 block discarded – undo
24 24
     public static $cols = [
25 25
         'name' => ['type' => 'text'],
26 26
         'description' => ['type' => 'html'],
27
-        'user_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'user'],
27
+        'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'],
28 28
         'date_create' => ['type' => 'dateTime'],
29 29
         //Менеджеры
30
-        'inputs' => [ 'type' => 'dataManager', 'relation' => 'inputs'],
30
+        'inputs' => ['type' => 'dataManager', 'relation' => 'inputs'],
31 31
     ];
32 32
     public static $dataManagers = [
33 33
         'manager' => [
Please login to merge, or discard this patch.
system/modules/Money/Money.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             if (empty($blocks[$block->wallet->currency_id])) {
103 103
                 $blocks[$block->wallet->currency_id] = $block->amount;
104 104
             } else {
105
-                $blocks[$block->wallet->currency_id]+= $block->amount;
105
+                $blocks[$block->wallet->currency_id] += $block->amount;
106 106
             }
107 107
         }
108 108
         return $blocks;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $rootUser = $rootUser ? $rootUser : \Users\User::$cur;
169 169
         $reward = \Money\Reward::get($reward_id);
170 170
         $reward->checkBlocked();
171
-        $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id]]);
171
+        $reward_count = \Money\Reward\Recive::getCount(['where' => ['reward_id', $reward_id]]);
172 172
         if ($reward_count >= $reward->quantity && $reward->quantity)
173 173
             return false;
174 174
         $types = $this->getSnippets('rewardType');
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                 $recives = \Money\Reward\Recive::getList(['where' => [['user_id', $user->id], ['reward_id', $reward->id]]]);
190 190
                 $amount = 0;
191 191
                 foreach ($recives as $recive) {
192
-                    $amount+=$recive->amount;
192
+                    $amount += $recive->amount;
193 193
                 }
194 194
                 if ($amount >= $reward->peruser) {
195 195
                     continue;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,8 @@  discard block
 block discarded – undo
49 49
     public function reciver($data, $system, $status, $mr) {
50 50
         if ($system) {
51 51
             $merchant = \Money\Merchant::get($system, 'object_name');
52
-        } else {
52
+        }
53
+        else {
53 54
             $merchant = false;
54 55
         }
55 56
         if ($merchant) {
@@ -96,7 +97,8 @@  discard block
 block discarded – undo
96 97
         foreach ($blocked as $block) {
97 98
             if (empty($blocks[$block->wallet->currency_id])) {
98 99
                 $blocks[$block->wallet->currency_id] = $block->amount;
99
-            } else {
100
+            }
101
+            else {
100 102
                 $blocks[$block->wallet->currency_id]+= $block->amount;
101 103
             }
102 104
         }
@@ -123,7 +125,8 @@  discard block
 block discarded – undo
123 125
                 $wallet->currency_id = $currency->id;
124 126
                 $wallet->save();
125 127
                 $result[$walletIdasKey ? $wallet->id : $currency->id] = $forSelect ? $wallet->name() : $wallet;
126
-            } else {
128
+            }
129
+            else {
127 130
                 $result[$walletIdasKey ? $wallets[$currency->id]->id : $currency->id] = $forSelect ? $wallets[$currency->id]->name() : $wallets[$currency->id];
128 131
             }
129 132
         }
Please login to merge, or discard this patch.
system/modules/Money/objects/Sums.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,21 +61,21 @@
 block discarded – undo
61 61
             if ($first) {
62 62
                 $first = false;
63 63
             } else {
64
-                $string.= '<br />';
64
+                $string .= '<br />';
65 65
             }
66
-            $string.= '<span style="white-space:nowrap;">';
67
-            $string.= number_format($sum, 2, '.', ' ');
66
+            $string .= '<span style="white-space:nowrap;">';
67
+            $string .= number_format($sum, 2, '.', ' ');
68 68
             if (\App::$cur->money) {
69 69
                 $currency = \Money\Currency::get($currency_id);
70 70
                 if ($currency) {
71
-                    $string.= ' ' . $currency->acronym();
71
+                    $string .= ' ' . $currency->acronym();
72 72
                 } else {
73
-                    $string.= ' руб.';
73
+                    $string .= ' руб.';
74 74
                 }
75 75
             } else {
76
-                $string.= ' руб.';
76
+                $string .= ' руб.';
77 77
             }
78
-            $string.= '</span>';
78
+            $string .= '</span>';
79 79
         }
80 80
         return $string;
81 81
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,8 @@  discard block
 block discarded – undo
54 54
         foreach ($this->sums as $currency_id => $sum) {
55 55
             if ($first) {
56 56
                 $first = false;
57
-            } else {
57
+            }
58
+            else {
58 59
                 $string.= '<br />';
59 60
             }
60 61
             $string.= '<span style="white-space:nowrap;">';
@@ -63,10 +64,12 @@  discard block
 block discarded – undo
63 64
                 $currency = \Money\Currency::get($currency_id);
64 65
                 if ($currency) {
65 66
                     $string.= ' ' . $currency->acronym();
66
-                } else {
67
+                }
68
+                else {
67 69
                     $string.= ' руб.';
68 70
                 }
69
-            } else {
71
+            }
72
+            else {
70 73
                 $string.= ' руб.';
71 74
             }
72 75
             $string.= '</span>';
Please login to merge, or discard this patch.
system/modules/Sitemap/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::$primary->config['moduleRouter']['sitemap.xml'] = 'Sitemap';
5 5
     \Config::save('app', App::$primary->config);
6 6
 };
Please login to merge, or discard this patch.
system/Inji/Module.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
      * Get installed modules for app
133 133
      * 
134 134
      * @param \App $app
135
-     * @param boolean|\App $primary
135
+     * @param App $primary
136 136
      * @return array
137 137
      */
138 138
     public static function getInstalled($app, $primary = false)
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -246,7 +246,8 @@  discard block
 block discarded – undo
246 246
                 if (strpos($pathName, 'slice')) {
247 247
                     $controllerName = ucfirst($this->params[0]);
248 248
                     $params = array_slice($this->params, 1);
249
-                } else {
249
+                }
250
+                else {
250 251
                     $controllerName = $this->moduleName;
251 252
                     $params = $this->params;
252 253
                 }
@@ -270,7 +271,8 @@  discard block
 block discarded – undo
270 271
     public static function getInfo($moduleName = '') {
271 272
         if (!$moduleName && get_called_class()) {
272 273
             $moduleName = get_called_class();
273
-        } elseif (!$moduleName) {
274
+        }
275
+        elseif (!$moduleName) {
274 276
             return [];
275 277
         }
276 278
         $paths = Module::getModulePaths($moduleName);
@@ -303,7 +305,8 @@  discard block
 block discarded – undo
303 305
                 foreach ($snippetsPaths as $snippetPath) {
304 306
                     if (is_dir($path . $dir . '/' . $snippetsPath . '/' . $snippetPath)) {
305 307
                         $snippets[$snippetPath] = include $path . $dir . '/' . $snippetsPath . '/' . $snippetPath . '/info.php';
306
-                    } else {
308
+                    }
309
+                    else {
307 310
                         $snippets[pathinfo($snippetPath, PATHINFO_FILENAME)] = include $path . $dir . '/' . $snippetsPath . '/' . $snippetPath;
308 311
                     }
309 312
                 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
         if (in_array($moduleName, self::getInstalled($app))) {
122 122
             return true;
123 123
         }
124
-        return FALSE;
124
+        return false;
125 125
     }
126 126
 
127 127
     /**
Please login to merge, or discard this patch.
system/modules/YandexExport/appControllers/YandexExportController.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -11,6 +11,10 @@
 block discarded – undo
11 11
 
12 12
     function indexAction() {
13 13
 
14
+        /**
15
+         * @param DOMDocument $xml
16
+         * @param string $nodeName
17
+         */
14 18
         function addToXml($xml, $parent, $nodeName, $text) {
15 19
             $node = $parent->appendChild($xml->createElement($nodeName));
16 20
             $node->appendChild($xml->createTextNode($text));
Please login to merge, or discard this patch.
system/modules/Files/Files.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
         if ($type->allow_resize && $type->options && json_decode($type->options, true)) {
60 60
             $typeOptions = json_decode($type->options, true);
61
-            list( $img_width, $img_height, $img_type, $img_tag ) = getimagesize($sitePath . $fileObject->path);
61
+            list($img_width, $img_height, $img_type, $img_tag) = getimagesize($sitePath . $fileObject->path);
62 62
             if ($img_height > $typeOptions['max_height'] || $img_width > $typeOptions['max_width']) {
63 63
                 Tools::resizeImage($sitePath . $fileObject->path, $typeOptions['max_width'], $typeOptions['max_height']);
64 64
             }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         if ($type->allow_resize && $type->options && json_decode($type->options, true)) {
122 122
             $typeOptions = json_decode($type->options, true);
123
-            list( $img_width, $img_height, $img_type, $img_tag ) = getimagesize($sitePath . $fileObject->path);
123
+            list($img_width, $img_height, $img_type, $img_tag) = getimagesize($sitePath . $fileObject->path);
124 124
             if ($img_height > $typeOptions['max_height'] || $img_width > $typeOptions['max_width']) {
125 125
                 Tools::resizeImage($sitePath . $fileObject->path, $typeOptions['max_width'], $typeOptions['max_height']);
126 126
             }
Please login to merge, or discard this patch.
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -22,16 +22,19 @@  discard block
 block discarded – undo
22 22
 
23 23
         $sitePath = App::$primary->path;
24 24
 
25
-        if (!is_uploaded_file($file['tmp_name']))
26
-            return 0;
25
+        if (!is_uploaded_file($file['tmp_name'])) {
26
+                    return 0;
27
+        }
27 28
 
28 29
         $fileinfo = pathinfo($file['name']);
29
-        if (empty($fileinfo['extension']))
30
-            return 0;
30
+        if (empty($fileinfo['extension'])) {
31
+                    return 0;
32
+        }
31 33
 
32 34
         $type = Files\Type::get($fileinfo['extension'], 'ext');
33
-        if (!$type)
34
-            return 0;
35
+        if (!$type) {
36
+                    return 0;
37
+        }
35 38
 
36 39
         if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) {
37 40
             return 0;
@@ -47,8 +50,9 @@  discard block
 block discarded – undo
47 50
         }
48 51
         $fileObject->name = $fileinfo['filename'];
49 52
         $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension'];
50
-        if ($fileObject->id && file_exists($sitePath . $fileObject->path))
51
-            unlink($sitePath . $fileObject->path);
53
+        if ($fileObject->id && file_exists($sitePath . $fileObject->path)) {
54
+                    unlink($sitePath . $fileObject->path);
55
+        }
52 56
 
53 57
         Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/');
54 58
 
@@ -84,12 +88,14 @@  discard block
 block discarded – undo
84 88
         $sitePath = App::$primary->path;
85 89
 
86 90
         $fileinfo = pathinfo($url);
87
-        if (empty($fileinfo['extension']))
88
-            return 0;
91
+        if (empty($fileinfo['extension'])) {
92
+                    return 0;
93
+        }
89 94
 
90 95
         $type = Files\Type::get($fileinfo['extension'], 'ext');
91
-        if (!$type)
92
-            return 0;
96
+        if (!$type) {
97
+                    return 0;
98
+        }
93 99
 
94 100
         if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) {
95 101
             return 0;
@@ -105,8 +111,9 @@  discard block
 block discarded – undo
105 111
         }
106 112
         $fileObject->name = $fileinfo['filename'];
107 113
         $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension'];
108
-        if ($fileObject->id && file_exists($sitePath . $fileObject->path))
109
-            unlink($sitePath . $fileObject->path);
114
+        if ($fileObject->id && file_exists($sitePath . $fileObject->path)) {
115
+                    unlink($sitePath . $fileObject->path);
116
+        }
110 117
 
111 118
         Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/');
112 119
 
Please login to merge, or discard this patch.
system/modules/Files/appAdminControllers/content/managerForEditor.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,33 +1,33 @@
 block discarded – undo
1 1
 <div class="container-fluid">
2 2
     <div class="row panel">
3 3
       <?php
4
-      if (!empty($_FILES['file'])) {
5
-          App::$cur->files->upload($_FILES['file'], ['upload_code' => 'editorManager']);
6
-      }
7
-      $form = new Ui\Form();
8
-      $form->begin();
9
-      $form->input('file', 'file', 'Загрузить файл');
10
-      echo '<div class="form-group"><button class ="btn btn-primary btn-sm">Загузить</button></div>';
11
-      $form->end(false);
12
-      ?>
4
+        if (!empty($_FILES['file'])) {
5
+            App::$cur->files->upload($_FILES['file'], ['upload_code' => 'editorManager']);
6
+        }
7
+        $form = new Ui\Form();
8
+        $form->begin();
9
+        $form->input('file', 'file', 'Загрузить файл');
10
+        echo '<div class="form-group"><button class ="btn btn-primary btn-sm">Загузить</button></div>';
11
+        $form->end(false);
12
+        ?>
13 13
     </div>
14 14
     <h2>Последние файлы</h2>
15 15
     <div class="row">
16 16
       <?php
17
-      $files = Files\File::getList(['where' => ['upload_code', 'editorManager'], 'limit' => 12, 'order' => ['date_create', 'DESC']]);
18
-      $i = 0;
19
-      foreach ($files as $file) {
20
-          ?>
17
+        $files = Files\File::getList(['where' => ['upload_code', 'editorManager'], 'limit' => 12, 'order' => ['date_create', 'DESC']]);
18
+        $i = 0;
19
+        foreach ($files as $file) {
20
+            ?>
21 21
             <div class="col-xs-6 col-sm-2 fileChooser" onclick="OpenFile('<?= $file->path; ?>');
22 22
                       return false;">
23 23
                 <div class="thumbnail">
24 24
                   <?php
25
-                  if ($file->type->group == 'image') {
26
-                      echo "<img class='img-responsive' src ='{$file->path}?resize=200x200' />";
27
-                  } else {
28
-                      echo "<img class='img-responsive' src ='/static/moduleAsset/Files/images/formats/" . pathinfo($file->path, PATHINFO_EXTENSION) . ".png' />";
29
-                  }
30
-                  ?>
25
+                    if ($file->type->group == 'image') {
26
+                        echo "<img class='img-responsive' src ='{$file->path}?resize=200x200' />";
27
+                    } else {
28
+                        echo "<img class='img-responsive' src ='/static/moduleAsset/Files/images/formats/" . pathinfo($file->path, PATHINFO_EXTENSION) . ".png' />";
29
+                    }
30
+                    ?>
31 31
 
32 32
                     <?= $file->name; ?><br />
33 33
                     <small class="text-muted">
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,8 @@
 block discarded – undo
24 24
                   <?php
25 25
                   if ($file->type->group == 'image') {
26 26
                       echo "<img class='img-responsive' src ='{$file->path}?resize=200x200' />";
27
-                  } else {
27
+                  }
28
+                  else {
28 29
                       echo "<img class='img-responsive' src ='/static/moduleAsset/Files/images/formats/" . pathinfo($file->path, PATHINFO_EXTENSION) . ".png' />";
29 30
                   }
30 31
                   ?>
Please login to merge, or discard this patch.
system/modules/Files/install_script.php 1 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
     $options = ['max_height' => 1200, 'max_width' => 1200];
5 5
     $types = [
6 6
         [
Please login to merge, or discard this patch.