Test Failed
Branch master (5aadec)
by Agel_Nash
04:00
created
assets/snippets/DocLister/lib/DLCollection.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-include_once(MODX_BASE_PATH . "assets/lib/Helpers/Collection.php");
2
+include_once(MODX_BASE_PATH."assets/lib/Helpers/Collection.php");
3 3
 
4 4
 /**
5 5
  * Class DLCollection
Please login to merge, or discard this patch.
assets/snippets/DocLister/core/filterDocLister.abstract.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     protected function build_sql_where($table_alias, $field, $operator, $value)
129 129
     {
130
-        $this->DocLister->debug->debug('Build SQL query for filters: ' . $this->DocLister->debug->dumpData(func_get_args()),
130
+        $this->DocLister->debug->debug('Build SQL query for filters: '.$this->DocLister->debug->dumpData(func_get_args()),
131 131
             'buildQuery', 2);
132 132
         $output = sqlHelper::tildeField($field, $table_alias);
133 133
 
@@ -135,28 +135,28 @@  discard block
 block discarded – undo
135 135
             case '=':
136 136
             case 'eq':
137 137
             case 'is':
138
-                $output .= " = '" . $this->modx->db->escape($value) . "'";
138
+                $output .= " = '".$this->modx->db->escape($value)."'";
139 139
                 break;
140 140
             case '!=':
141 141
             case 'no':
142 142
             case 'isnot':
143
-                $output .= " != '" . $this->modx->db->escape($value) . "'";
143
+                $output .= " != '".$this->modx->db->escape($value)."'";
144 144
                 break;
145 145
             case '>':
146 146
             case 'gt':
147
-                $output .= ' > ' . str_replace(',', '.', floatval($value));
147
+                $output .= ' > '.str_replace(',', '.', floatval($value));
148 148
                 break;
149 149
             case '<':
150 150
             case 'lt':
151
-                $output .= ' < ' . str_replace(',', '.', floatval($value));
151
+                $output .= ' < '.str_replace(',', '.', floatval($value));
152 152
                 break;
153 153
             case '<=':
154 154
             case 'elt':
155
-                $output .= ' <= ' . str_replace(',', '.', floatval($value));
155
+                $output .= ' <= '.str_replace(',', '.', floatval($value));
156 156
                 break;
157 157
             case '>=':
158 158
             case 'egt':
159
-                $output .= ' >= ' . str_replace(',', '.', floatval($value));
159
+                $output .= ' >= '.str_replace(',', '.', floatval($value));
160 160
                 break;
161 161
             case '%':
162 162
             case 'like':
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
                 $output = $this->DocLister->LikeEscape($output, $value, '=', '%[+value+]');
170 170
                 break;
171 171
             case 'regexp':
172
-                $output .= " REGEXP '" . $this->modx->db->escape($value) . "'";
172
+                $output .= " REGEXP '".$this->modx->db->escape($value)."'";
173 173
                 break;
174 174
             case 'against':
175 175
                 /** content:pagetitle,description,content,introtext:against:искомая строка */
@@ -192,16 +192,16 @@  discard block
 block discarded – undo
192 192
                     $word_arr[] = $this->DocLister->LikeEscape($output, $word);
193 193
                 }
194 194
                 if (!empty($word_arr)) {
195
-                    $output = '(' . implode(' OR ', $word_arr) . ')';
195
+                    $output = '('.implode(' OR ', $word_arr).')';
196 196
                 } else {
197 197
                     $output = '';
198 198
                 }
199 199
                 break;
200 200
             case 'in':
201
-                $output .= ' IN(' . $this->DocLister->sanitarIn($value, ',', true) . ')';
201
+                $output .= ' IN('.$this->DocLister->sanitarIn($value, ',', true).')';
202 202
                 break;
203 203
             case 'notin':
204
-                $output .= ' NOT IN(' . $this->DocLister->sanitarIn($value, ',', true) . ')';
204
+                $output .= ' NOT IN('.$this->DocLister->sanitarIn($value, ',', true).')';
205 205
                 break;
206 206
             default:
207 207
                 $output = '';
Please login to merge, or discard this patch.
assets/snippets/DocLister/core/filter/tv.filter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
                 $this->tv_id = $tmp[0];
50 50
             }
51 51
             if (!$this->tv_id) {
52
-                $tvid = $this->modx->db->query("SELECT id FROM " . $this->DocLister->getTable('site_tmplvars') . " WHERE `name` = '" . $this->modx->db->escape($this->field) . "'");
52
+                $tvid = $this->modx->db->query("SELECT id FROM ".$this->DocLister->getTable('site_tmplvars')." WHERE `name` = '".$this->modx->db->escape($this->field)."'");
53 53
                 $this->tv_id = intval($this->modx->db->getValue($tvid));
54 54
             }
55 55
 
56 56
             if (!$this->tv_id) {
57
-                $this->DocLister->debug->warning('DocLister filtering by template variable "' . $this->DocLister->debug->dumpData($this->field) . '" failed. TV not found!');
57
+                $this->DocLister->debug->warning('DocLister filtering by template variable "'.$this->DocLister->debug->dumpData($this->field).'" failed. TV not found!');
58 58
             } else {
59 59
                 // create the alias for the join
60
-                $alias = 'dltv_' . $this->field;
60
+                $alias = 'dltv_'.$this->field;
61 61
                 if ($this->totalFilters > 0) {
62
-                    $alias .= '_' . $this->totalFilters;
62
+                    $alias .= '_'.$this->totalFilters;
63 63
                 }
64 64
                 $this->setTableAlias($alias);
65 65
                 $this->tvName = $this->field;
@@ -79,10 +79,10 @@  discard block
 block discarded – undo
79 79
         $join = '';
80 80
         $exists = $this->DocLister->checkTableAlias($this->tvName, $this->extTV->tvValuesTable());
81 81
         $alias = $this->DocLister->TableAlias($this->tvName, $this->extTV->tvValuesTable(), $this->getTableAlias());
82
-        $this->field = $alias . ".value";
82
+        $this->field = $alias.".value";
83 83
         if (!$exists) {
84
-            $join = 'LEFT JOIN ' . $this->DocLister->getTable($this->extTV->tvValuesTable(),
85
-                    $alias) . ' ON `' . $alias . '`.`contentid`=`' . content_DL_filter::TableAlias . '`.`id` AND `' . $alias . '`.`tmplvarid`=' . $this->tv_id;
84
+            $join = 'LEFT JOIN '.$this->DocLister->getTable($this->extTV->tvValuesTable(),
85
+                    $alias).' ON `'.$alias.'`.`contentid`=`'.content_DL_filter::TableAlias.'`.`id` AND `'.$alias.'`.`tmplvarid`='.$this->tv_id;
86 86
         } else {
87 87
             $this->setTableAlias($alias);
88 88
         }
Please login to merge, or discard this patch.
assets/snippets/DocLister/snippet.DLReflect.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@
 block discarded – undo
44 44
 $reflectTPL = APIHelpers::getkey($params, 'reflectTPL',
45 45
     '@CODE: <li><a href="[+url+]" title="[+title+]">[+title+]</a></li>');
46 46
 /**
47
- * activeReflectTPL
48
- *        Шаблон активной даты.
49
- *    Поддерживается такие же плейсхолдеры, как и в шаблоне reflectTPL
50
- */
47
+     * activeReflectTPL
48
+     *        Шаблон активной даты.
49
+     *    Поддерживается такие же плейсхолдеры, как и в шаблоне reflectTPL
50
+     */
51 51
 $activeReflectTPL = APIHelpers::getkey($params, 'activeReflectTPL', '@CODE: <li><span>[+title+]</span></li>');
52 52
 
53 53
 list($dateFormat, $sqlDateFormat, $reflectValidator) = DLReflect::switchReflect($reflectType, function () {
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
  *    &limitAfter=`3`
11 11
  * ]]
12 12
  */
13
-include_once(MODX_BASE_PATH . 'assets/snippets/DocLister/lib/DLCollection.class.php');
14
-include_once(MODX_BASE_PATH . 'assets/lib/APIHelpers.class.php');
15
-include_once(MODX_BASE_PATH . 'assets/snippets/DocLister/lib/DLReflect.class.php');
13
+include_once(MODX_BASE_PATH.'assets/snippets/DocLister/lib/DLCollection.class.php');
14
+include_once(MODX_BASE_PATH.'assets/lib/APIHelpers.class.php');
15
+include_once(MODX_BASE_PATH.'assets/snippets/DocLister/lib/DLReflect.class.php');
16 16
 
17 17
 $params = is_array($modx->event->params) ? $modx->event->params : array();
18 18
 
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
  */
51 51
 $activeReflectTPL = APIHelpers::getkey($params, 'activeReflectTPL', '@CODE: <li><span>[+title+]</span></li>');
52 52
 
53
-list($dateFormat, $sqlDateFormat, $reflectValidator) = DLReflect::switchReflect($reflectType, function () {
53
+list($dateFormat, $sqlDateFormat, $reflectValidator) = DLReflect::switchReflect($reflectType, function(){
54 54
     return array('m-Y', '%m-%Y', array('DLReflect', 'validateMonth'));
55
-}, function () {
55
+}, function(){
56 56
     return array('Y', '%Y', array('DLReflect', 'validateYear'));
57 57
 });
58 58
 $tmp = $originalDate = date($dateFormat);
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
  * Возможные значения: Любое число. 0 расценивается как все доступные месяцы
143 143
  * Значение по умолчанию: 0
144 144
  */
145
-$limitBefore = (int)APIHelpers::getkey($params, 'limitBefore', 0);
145
+$limitBefore = (int) APIHelpers::getkey($params, 'limitBefore', 0);
146 146
 /**
147 147
  * limitAfter
148 148
  *        Число элементов после месяца указанного в activeMonth параметре
149 149
  * Возможные значения: Любое число. 0 расценивается как все доступные месяцы
150 150
  * Значение по умолчанию: 0
151 151
  */
152
-$limitAfter = (int)APIHelpers::getkey($params, 'limitAfter', 0);
152
+$limitAfter = (int) APIHelpers::getkey($params, 'limitAfter', 0);
153 153
 $display = $limitBefore + 1 + $limitAfter;
154 154
 
155 155
 $out = '';
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 $DLParams['saveDLObject'] = 'DLAPI';
162 162
 if ($reflectSource == 'tv') {
163 163
     $DLParams['tvSortType'] = 'TVDATETIME';
164
-    $DLParams['selectFields'] = "DATE_FORMAT(STR_TO_DATE(`dltv_" . $reflectField . "_1`.`value`,'%d-%m-%Y %H:%i:%s'), '" . $sqlDateFormat . "') as `id`";
164
+    $DLParams['selectFields'] = "DATE_FORMAT(STR_TO_DATE(`dltv_".$reflectField."_1`.`value`,'%d-%m-%Y %H:%i:%s'), '".$sqlDateFormat."') as `id`";
165 165
 } else {
166 166
     $DLParams['orderBy'] = $reflectField;
167
-    $DLParams['selectFields'] = "DATE_FORMAT(FROM_UNIXTIME(" . $reflectField . "), '" . $sqlDateFormat . "') as `id`";
167
+    $DLParams['selectFields'] = "DATE_FORMAT(FROM_UNIXTIME(".$reflectField."), '".$sqlDateFormat."') as `id`";
168 168
 }
169 169
 $totalReflects = $modx->runSnippet('DocLister', $DLParams);
170 170
 /** Получаем объект DocLister'a */
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     $totalReflects = array();
182 182
 }
183 183
 $totalReflects = new DLCollection($modx, $totalReflects);
184
-$totalReflects = $totalReflects->filter(function ($el) {
184
+$totalReflects = $totalReflects->filter(function($el){
185 185
     return !empty($el['id']);
186 186
 });
187 187
 /** Добавляем активную дату в коллекцию */
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     $totalReflects->add(array('id' => $originalCurrentReflect), $originalCurrentReflect);
196 196
 }
197 197
 /** Сортируем даты по возрастанию */
198
-$totalReflects->sort(function ($a, $b) use ($dateFormat) {
198
+$totalReflects->sort(function($a, $b) use ($dateFormat) {
199 199
     $aDate = DateTime::createFromFormat($dateFormat, $a['id']);
200 200
     $bDate = DateTime::createFromFormat($dateFormat, $b['id']);
201 201
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 })->reindex();
204 204
 
205 205
 /** Разделяем коллекцию дат на 2 части (до текущей даты и после) */
206
-list($lReflect, $rReflect) = $totalReflects->partition(function ($key, $val) use (
206
+list($lReflect, $rReflect) = $totalReflects->partition(function($key, $val) use (
207 207
     $activeReflect,
208 208
     $originalDate,
209 209
     $dateFormat
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
 $sortDir = APIHelpers::getkey($params, 'sortDir', 'ASC');
269 269
 /** Сортируем результатирующий список  */
270
-$outReflects = $outReflects->sort(function ($a, $b) use ($sortDir, $dateFormat) {
270
+$outReflects = $outReflects->sort(function($a, $b) use ($sortDir, $dateFormat) {
271 271
     $aDate = DateTime::createFromFormat($dateFormat, $a);
272 272
     $bDate = DateTime::createFromFormat($dateFormat, $b);
273 273
     $out = false;
@@ -287,15 +287,15 @@  discard block
 block discarded – undo
287 287
 foreach ($outReflects as $reflectItem) {
288 288
     $tpl = (!is_null($activeReflect) && $activeReflect == $reflectItem) ? $activeReflectTPL : $reflectTPL;
289 289
 
290
-    $data = DLReflect::switchReflect($reflectType, function () use ($reflectItem, $DLAPI) {
290
+    $data = DLReflect::switchReflect($reflectType, function() use ($reflectItem, $DLAPI) {
291 291
         list($vMonth, $vYear) = explode('-', $reflectItem, 2);
292 292
 
293 293
         return array(
294 294
             'monthNum'  => $vMonth,
295
-            'monthName' => $DLAPI->getMsg('months.' . (int)$vMonth),
295
+            'monthName' => $DLAPI->getMsg('months.'.(int) $vMonth),
296 296
             'year'      => $vYear,
297 297
         );
298
-    }, function () use ($reflectItem) {
298
+    }, function() use ($reflectItem) {
299 299
         return array(
300 300
             'year' => $reflectItem
301 301
         );
@@ -327,4 +327,4 @@  discard block
 block discarded – undo
327 327
     $debug = '';
328 328
 }
329 329
 
330
-return $debug . $out;
330
+return $debug.$out;
Please login to merge, or discard this patch.
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
  */
51 51
 $activeReflectTPL = APIHelpers::getkey($params, 'activeReflectTPL', '@CODE: <li><span>[+title+]</span></li>');
52 52
 
53
-list($dateFormat, $sqlDateFormat, $reflectValidator) = DLReflect::switchReflect($reflectType, function () {
53
+list($dateFormat, $sqlDateFormat, $reflectValidator) = DLReflect::switchReflect($reflectType, function (){
54 54
     return array('m-Y', '%m-%Y', array('DLReflect', 'validateMonth'));
55
-}, function () {
55
+}, function (){
56 56
     return array('Y', '%Y', array('DLReflect', 'validateYear'));
57 57
 });
58 58
 $tmp = $originalDate = date($dateFormat);
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     $totalReflects = array();
182 182
 }
183 183
 $totalReflects = new DLCollection($modx, $totalReflects);
184
-$totalReflects = $totalReflects->filter(function ($el) {
184
+$totalReflects = $totalReflects->filter(function ($el){
185 185
     return !empty($el['id']);
186 186
 });
187 187
 /** Добавляем активную дату в коллекцию */
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     $totalReflects->add(array('id' => $originalCurrentReflect), $originalCurrentReflect);
196 196
 }
197 197
 /** Сортируем даты по возрастанию */
198
-$totalReflects->sort(function ($a, $b) use ($dateFormat) {
198
+$totalReflects->sort(function ($a, $b) use ($dateFormat){
199 199
     $aDate = DateTime::createFromFormat($dateFormat, $a['id']);
200 200
     $bDate = DateTime::createFromFormat($dateFormat, $b['id']);
201 201
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     $activeReflect,
208 208
     $originalDate,
209 209
     $dateFormat
210
-) {
210
+){
211 211
     $aDate = DateTime::createFromFormat($dateFormat, $val['id']);
212 212
     if (is_null($activeReflect)) {
213 213
         $activeReflect = $originalDate;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
 $sortDir = APIHelpers::getkey($params, 'sortDir', 'ASC');
269 269
 /** Сортируем результатирующий список  */
270
-$outReflects = $outReflects->sort(function ($a, $b) use ($sortDir, $dateFormat) {
270
+$outReflects = $outReflects->sort(function ($a, $b) use ($sortDir, $dateFormat){
271 271
     $aDate = DateTime::createFromFormat($dateFormat, $a);
272 272
     $bDate = DateTime::createFromFormat($dateFormat, $b);
273 273
     $out = false;
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 foreach ($outReflects as $reflectItem) {
288 288
     $tpl = (!is_null($activeReflect) && $activeReflect == $reflectItem) ? $activeReflectTPL : $reflectTPL;
289 289
 
290
-    $data = DLReflect::switchReflect($reflectType, function () use ($reflectItem, $DLAPI) {
290
+    $data = DLReflect::switchReflect($reflectType, function () use ($reflectItem, $DLAPI){
291 291
         list($vMonth, $vYear) = explode('-', $reflectItem, 2);
292 292
 
293 293
         return array(
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
             'monthName' => $DLAPI->getMsg('months.' . (int)$vMonth),
296 296
             'year'      => $vYear,
297 297
         );
298
-    }, function () use ($reflectItem) {
298
+    }, function () use ($reflectItem){
299 299
         return array(
300 300
             'year' => $reflectItem
301 301
         );
Please login to merge, or discard this patch.
assets/snippets/DocLister/core/filter/private.filter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
             $docgrp = implode(",", $docgrp);
39 39
         }
40 40
         $alias = parent::TableAlias;
41
-        $where = ($this->modx->isFrontend() ? "`{$alias}`.`privateweb`=0" : "1='{$_SESSION['mgrRole']}' OR {$alias}.`privatemgr`=0") . (!$docgrp ? "" : " OR `{$this->tableAlias}`.`document_group` IN ({$docgrp})");
41
+        $where = ($this->modx->isFrontend() ? "`{$alias}`.`privateweb`=0" : "1='{$_SESSION['mgrRole']}' OR {$alias}.`privatemgr`=0").(!$docgrp ? "" : " OR `{$this->tableAlias}`.`document_group` IN ({$docgrp})");
42 42
 
43 43
         return "($where)";
44 44
     }
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function get_join()
50 50
     {
51
-        $join = 'LEFT JOIN ' . $this->DocLister->getTable('document_groups',
52
-                $this->tableAlias) . ' ON `' . $this->tableAlias . '`.`document`=`' . parent::TableAlias . '`.`id`';
51
+        $join = 'LEFT JOIN '.$this->DocLister->getTable('document_groups',
52
+                $this->tableAlias).' ON `'.$this->tableAlias.'`.`document`=`'.parent::TableAlias.'`.`id`';
53 53
 
54 54
         return $join;
55 55
     }
Please login to merge, or discard this patch.
assets/snippets/DocLister/core/extender/tv.extender.inc 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
         $tbl_site_tmplvars = $this->DocLister->getTable('site_tmplvars');
220 220
         $fields = 'id,name,default_text as value,display,display_params,type';
221 221
         $implodeTvId = implode(',', $tvId);
222
-        $rs = $this->DocLister->dbQuery("SELECT {$fields} FROM {$tbl_site_tmplvars} WHERE id IN({$implodeTvId})");
222
+        $rs = $this->DocLister->dbQuery("select {$fields} FROM {$tbl_site_tmplvars} WHERE id IN({$implodeTvId})");
223 223
         $rows = $this->modx->db->makeArray($rs);
224 224
         $out = array();
225 225
         foreach ($rows as $item) {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         $tvPrefix = $this->_TVprefix;
116 116
 
117 117
         foreach ($rows as $item) {
118
-            $out[$item['contentid']][$tvPrefix . $tv[$item['tmplvarid']]] = $item['value'];
118
+            $out[$item['contentid']][$tvPrefix.$tv[$item['tmplvarid']]] = $item['value'];
119 119
         }
120 120
         $tmp = explode(",", $this->DocLister->sanitarIn($IDs, ',', false));
121 121
         foreach ($tmp as $item) {
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                 $out = array_unique($tmp);
168 168
                 $tmp = array();
169 169
                 foreach ($out as $item) {
170
-                    $tmp[] = $this->_TVprefix . $item;
170
+                    $tmp[] = $this->_TVprefix.$item;
171 171
                 }
172 172
             }
173 173
         } else {
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
      */
187 187
     public function renderTV($iddoc, $tvname, $tvval, $param)
188 188
     {
189
-        include_once MODX_MANAGER_PATH . "includes/tmplvars.format.inc.php";
190
-        include_once MODX_MANAGER_PATH . "includes/tmplvars.commands.inc.php";
189
+        include_once MODX_MANAGER_PATH."includes/tmplvars.format.inc.php";
190
+        include_once MODX_MANAGER_PATH."includes/tmplvars.commands.inc.php";
191 191
 
192 192
         return getTVDisplayFormat($tvname, $tvval, $param['display'], $param['display_params'], $param['type'], $iddoc,
193 193
             '');
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
         $rows = $this->modx->db->makeArray($rs);
227 227
         $out = array();
228 228
         foreach ($rows as $item) {
229
-            $out[$this->_TVprefix . $item['name']] = $item;
229
+            $out[$this->_TVprefix.$item['name']] = $item;
230 230
         }
231 231
 
232 232
         return $out;
@@ -265,20 +265,20 @@  discard block
 block discarded – undo
265 265
                 $item = explode(" ", trim($item), 2);
266 266
                 if (isset($TVnames[$item[0]])) {
267 267
                     $exists = $this->DocLister->checkTableAlias($item[0], $this->tvValuesTable());
268
-                    $prefix = 'dltv_' . $item[0] . '_' . ($i + 1);
268
+                    $prefix = 'dltv_'.$item[0].'_'.($i + 1);
269 269
                     $prefix = $this->storeTable ? $this->DocLister->TableAlias($item[0], $this->tvValuesTable(),
270 270
                         $prefix) : $prefix;
271 271
                     if (!$exists) {
272
-                        $table .= " LEFT JOIN " . $this->DocLister->getTable($this->tvValuesTable(), $prefix) . "
273
-                        on `" . $prefix . "`.`contentid`=`c`.`id` AND `" . $prefix . "`.`tmplvarid`=" . $TVnames[$item[0]];
272
+                        $table .= " LEFT JOIN ".$this->DocLister->getTable($this->tvValuesTable(), $prefix)."
273
+                        on `" . $prefix."`.`contentid`=`c`.`id` AND `".$prefix."`.`tmplvarid`=".$TVnames[$item[0]];
274 274
                     }
275 275
                     if (in_array($item[0], $withDefault)) {
276 276
                         $exists = $this->DocLister->checkTableAlias($item[0], "site_tmplvars");
277 277
                         $dPrefix = $this->storeTable ? $this->DocLister->TableAlias($item[0], "site_tmplvars",
278
-                            'd_' . $prefix) : 'd_' . $prefix;
278
+                            'd_'.$prefix) : 'd_'.$prefix;
279 279
                         if (!$exists) {
280
-                            $table .= " LEFT JOIN " . $this->DocLister->getTable("site_tmplvars",
281
-                                    $dPrefix) . " on `" . $dPrefix . "`.`id` = " . $TVnames[$item[0]];
280
+                            $table .= " LEFT JOIN ".$this->DocLister->getTable("site_tmplvars",
281
+                                    $dPrefix)." on `".$dPrefix."`.`id` = ".$TVnames[$item[0]];
282 282
                         }
283 283
                         $field = "IFNULL(`{$prefix}`.`value`, `{$dPrefix}`.`default_text`)";
284 284
                     } else {
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
                 }
289 289
                 $item = implode(" ", $item);
290 290
             }
291
-            $sort = "ORDER BY " . implode(",", $matches);
291
+            $sort = "ORDER BY ".implode(",", $matches);
292 292
         }
293 293
 
294 294
         return array($table, $sort);
Please login to merge, or discard this patch.
Braces   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
  * Обработка TV параметров перед выводом
11 11
  *
12 12
  */
13
-class tv_DL_Extender extends extDocLister
14
-{
13
+class tv_DL_Extender extends extDocLister
14
+{
15 15
     /**
16 16
      * @var mixed|string
17 17
      */
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
      * @param DocLister $DocLister
33 33
      * @param $name
34 34
      */
35
-    public function __construct($DocLister, $name)
36
-    {
35
+    public function __construct($DocLister, $name)
36
+    {
37 37
         parent::__construct($DocLister, $name);
38
-        if (!isset($this->modx->_TVnames)) {
38
+        if (!isset($this->modx->_TVnames)) {
39 39
             $this->modx->_TVnames = array();
40 40
         }
41 41
         $this->tvValuesTable = $this->DocLister->getCFGDef('tvValuesTable', $this->tvValuesTable());
@@ -45,26 +45,26 @@  discard block
 block discarded – undo
45 45
     /**
46 46
      * @return bool
47 47
      */
48
-    protected function run()
49
-    {
48
+    protected function run()
49
+    {
50 50
         return true;
51 51
     }
52 52
 
53 53
     /**
54 54
      * @return mixed|string
55 55
      */
56
-    public function tvValuesTable()
57
-    {
56
+    public function tvValuesTable()
57
+    {
58 58
         return $this->tvValuesTable;
59 59
     }
60 60
 
61 61
     /**
62 62
      * @return mixed
63 63
      */
64
-    public function getTVnames()
65
-    {
64
+    public function getTVnames()
65
+    {
66 66
         $out = array();
67
-        foreach ($this->modx->_TVnames as $name => $tv) {
67
+        foreach ($this->modx->_TVnames as $name => $tv) {
68 68
             $out[$name] = $tv['id'];
69 69
         }
70 70
 
@@ -75,14 +75,14 @@  discard block
 block discarded – undo
75 75
      * @param bool $reload
76 76
      * @return mixed
77 77
      */
78
-    public function getAllTV_Name($reload = false)
79
-    {
80
-        if (empty($this->modx->_TVnames) || $reload) {
78
+    public function getAllTV_Name($reload = false)
79
+    {
80
+        if (empty($this->modx->_TVnames) || $reload) {
81 81
             $from = $this->DocLister->getTable('site_tmplvars');
82 82
             $rs = $this->DocLister->dbQuery("SELECT `id`, `name`, `type` FROM {$from}");
83 83
             $rows = $this->modx->db->makeArray($rs);
84 84
 
85
-            foreach ($rows as $item) {
85
+            foreach ($rows as $item) {
86 86
                 $this->modx->_TVnames[$item['name']] = array(
87 87
                     "id"   => $item['id'],
88 88
                     "type" => $item['type']
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
      * @param $tvlist
99 99
      * @return array
100 100
      */
101
-    public function getTVList($IDs, $tvlist)
102
-    {
101
+    public function getTVList($IDs, $tvlist)
102
+    {
103 103
         $out = array();
104 104
         $tv = $this->getTVid($tvlist);
105
-        if (empty($tv)) {
105
+        if (empty($tv)) {
106 106
             return $out;
107 107
         }
108 108
         $tvId = array_keys($tv);
@@ -114,24 +114,24 @@  discard block
 block discarded – undo
114 114
         $rows = $this->modx->db->makeArray($rs);
115 115
         $tvPrefix = $this->_TVprefix;
116 116
 
117
-        foreach ($rows as $item) {
117
+        foreach ($rows as $item) {
118 118
             $out[$item['contentid']][$tvPrefix . $tv[$item['tmplvarid']]] = $item['value'];
119 119
         }
120 120
         $tmp = explode(",", $this->DocLister->sanitarIn($IDs, ',', false));
121
-        foreach ($tmp as $item) {
122
-            if (!isset($out[$item])) {
121
+        foreach ($tmp as $item) {
122
+            if (!isset($out[$item])) {
123 123
                 $out[$item] = array();
124 124
             };
125 125
         }
126 126
         $renderTV = $this->getListRenderTV();
127 127
         $tvDef = $this->loadTVDefault($tvId);
128 128
         $TVkeys = array_keys($tvDef);
129
-        foreach ($out as $itemid => $item) {
130
-            foreach ($TVkeys as $name) {
131
-                if (!isset($out[$itemid][$name])) {
129
+        foreach ($out as $itemid => $item) {
130
+            foreach ($TVkeys as $name) {
131
+                if (!isset($out[$itemid][$name])) {
132 132
                     $out[$itemid][$name] = $tvDef[$name]['value'];
133 133
                 }
134
-                if (in_array($name, $renderTV) || $renderTV == array("*")) {
134
+                if (in_array($name, $renderTV) || $renderTV == array("*")) {
135 135
                     $out[$itemid][$name] = $this->renderTV($itemid, $name, $out[$itemid][$name], $tvDef[$name]);
136 136
                 }
137 137
             }
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
     /**
144 144
      * @return mixed|string
145 145
      */
146
-    public function getTVprefix()
147
-    {
146
+    public function getTVprefix()
147
+    {
148 148
         $tvPrefix = $this->DocLister->getCFGDef('tvPrefix', 'tv');
149
-        if (!empty($tvPrefix)) {
149
+        if (!empty($tvPrefix)) {
150 150
             $tvPrefix .= '.';
151 151
         }
152 152
 
@@ -156,21 +156,21 @@  discard block
 block discarded – undo
156 156
     /**
157 157
      * @return array|mixed
158 158
      */
159
-    public function getListRenderTV()
160
-    {
159
+    public function getListRenderTV()
160
+    {
161 161
         $tmp = $this->DocLister->getCFGDef('renderTV', '');
162
-        if ($tmp != '' && $tmp != '*') {
162
+        if ($tmp != '' && $tmp != '*') {
163 163
             $tmp = explode(",", $tmp);
164
-            if (in_array("*", $tmp)) {
164
+            if (in_array("*", $tmp)) {
165 165
                 $tmp = array("*");
166
-            } else {
166
+            } else {
167 167
                 $out = array_unique($tmp);
168 168
                 $tmp = array();
169
-                foreach ($out as $item) {
169
+                foreach ($out as $item) {
170 170
                     $tmp[] = $this->_TVprefix . $item;
171 171
                 }
172 172
             }
173
-        } else {
173
+        } else {
174 174
             $tmp = array($tmp);
175 175
         }
176 176
 
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
      * @param $param
185 185
      * @return mixed
186 186
      */
187
-    public function renderTV($iddoc, $tvname, $tvval, $param)
188
-    {
187
+    public function renderTV($iddoc, $tvname, $tvval, $param)
188
+    {
189 189
         include_once MODX_MANAGER_PATH . "includes/tmplvars.format.inc.php";
190 190
         include_once MODX_MANAGER_PATH . "includes/tmplvars.commands.inc.php";
191 191
 
@@ -197,15 +197,15 @@  discard block
 block discarded – undo
197 197
      * @param $tvlist
198 198
      * @return array
199 199
      */
200
-    public function getTVid($tvlist)
201
-    {
202
-        if (!empty($tvlist) && is_scalar($tvlist)) {
200
+    public function getTVid($tvlist)
201
+    {
202
+        if (!empty($tvlist) && is_scalar($tvlist)) {
203 203
             $tvlist = explode(",", $tvlist);
204 204
         }
205 205
         $out = array();
206
-        foreach ($tvlist as $tv) {
206
+        foreach ($tvlist as $tv) {
207 207
             $tv = trim($tv);
208
-            if (isset($this->modx->_TVnames[$tv])) {
208
+            if (isset($this->modx->_TVnames[$tv])) {
209 209
                 $out[$this->modx->_TVnames[$tv]['id']] = $tv;
210 210
             }
211 211
         }
@@ -217,15 +217,15 @@  discard block
 block discarded – undo
217 217
      * @param $tvId
218 218
      * @return array
219 219
      */
220
-    public function loadTVDefault($tvId)
221
-    {
220
+    public function loadTVDefault($tvId)
221
+    {
222 222
         $tbl_site_tmplvars = $this->DocLister->getTable('site_tmplvars');
223 223
         $fields = 'id,name,default_text as value,display,display_params,type';
224 224
         $implodeTvId = implode(',', $tvId);
225 225
         $rs = $this->DocLister->dbQuery("SELECT {$fields} FROM {$tbl_site_tmplvars} WHERE id IN({$implodeTvId})");
226 226
         $rows = $this->modx->db->makeArray($rs);
227 227
         $out = array();
228
-        foreach ($rows as $item) {
228
+        foreach ($rows as $item) {
229 229
             $out[$this->_TVprefix . $item['name']] = $item;
230 230
         }
231 231
 
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
      * @param $name
237 237
      * @return string
238 238
      */
239
-    public function addTVSortWithDefault($name)
240
-    {
239
+    public function addTVSortWithDefault($name)
240
+    {
241 241
         $dTV = explode(',', $this->DocLister->getCFGDef('tvSortWithDefault', ''));
242 242
         $dTV[] = $name;
243 243
         $tvList = implode(",", array_unique($dTV));
@@ -251,37 +251,37 @@  discard block
 block discarded – undo
251 251
      * @param $sort
252 252
      * @return array
253 253
      */
254
-    public function injectSortByTV($table, $sort)
255
-    {
256
-        if (preg_match("/^ORDER BY (.*)/", $sort, $match)) {
254
+    public function injectSortByTV($table, $sort)
255
+    {
256
+        if (preg_match("/^ORDER BY (.*)/", $sort, $match)) {
257 257
             $TVnames = $this->getTVnames();
258
-            if (!is_array($TVnames)) {
258
+            if (!is_array($TVnames)) {
259 259
                 $TVnames = array();
260 260
             }
261 261
             $matches = explode(",", $match[1]);
262 262
             $sortType = explode(",", $this->DocLister->getCFGDef('tvSortType'));
263 263
             $withDefault = explode(",", $this->DocLister->getCFGDef('tvSortWithDefault'));
264
-            foreach ($matches as $i => &$item) {
264
+            foreach ($matches as $i => &$item) {
265 265
                 $item = explode(" ", trim($item), 2);
266
-                if (isset($TVnames[$item[0]])) {
266
+                if (isset($TVnames[$item[0]])) {
267 267
                     $exists = $this->DocLister->checkTableAlias($item[0], $this->tvValuesTable());
268 268
                     $prefix = 'dltv_' . $item[0] . '_' . ($i + 1);
269 269
                     $prefix = $this->storeTable ? $this->DocLister->TableAlias($item[0], $this->tvValuesTable(),
270 270
                         $prefix) : $prefix;
271
-                    if (!$exists) {
271
+                    if (!$exists) {
272 272
                         $table .= " LEFT JOIN " . $this->DocLister->getTable($this->tvValuesTable(), $prefix) . "
273 273
                         on `" . $prefix . "`.`contentid`=`c`.`id` AND `" . $prefix . "`.`tmplvarid`=" . $TVnames[$item[0]];
274 274
                     }
275
-                    if (in_array($item[0], $withDefault)) {
275
+                    if (in_array($item[0], $withDefault)) {
276 276
                         $exists = $this->DocLister->checkTableAlias($item[0], "site_tmplvars");
277 277
                         $dPrefix = $this->storeTable ? $this->DocLister->TableAlias($item[0], "site_tmplvars",
278 278
                             'd_' . $prefix) : 'd_' . $prefix;
279
-                        if (!$exists) {
279
+                        if (!$exists) {
280 280
                             $table .= " LEFT JOIN " . $this->DocLister->getTable("site_tmplvars",
281 281
                                     $dPrefix) . " on `" . $dPrefix . "`.`id` = " . $TVnames[$item[0]];
282 282
                         }
283 283
                         $field = "IFNULL(`{$prefix}`.`value`, `{$dPrefix}`.`default_text`)";
284
-                    } else {
284
+                    } else {
285 285
                         $field = "`{$prefix}`.`value`";
286 286
                     }
287 287
                     $item[0] = $this->DocLister->changeSortType($field, isset($sortType[$i]) ? $sortType[$i] : null);
Please login to merge, or discard this patch.
assets/lib/SimpleTab/table.abstract.php 3 patches
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $index = $this->modx->db->getValue($rows);
62 62
         $index = $index - 1;
63 63
         $this->query("SET @index := " . $index);
64
-        $this->query("UPDATE {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->indexName}`>{$index} AND `{$this->rfName}`={$rid} AND `{$this->pkName}` NOT IN ({$ids})) ORDER BY `{$this->indexName}` ASC");
64
+        $this->query("update {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->indexName}`>{$index} AND `{$this->rfName}`={$rid} AND `{$this->pkName}` NOT IN ({$ids})) ORDER BY `{$this->indexName}` ASC");
65 65
         $out = $this->modx->db->getAffectedRows();
66 66
 
67 67
         return $out;
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
         $ids = implode(',', $ids);
97 97
         if ($dir == 'top') {
98 98
             $this->query("SET @index := " . ($index - $cnt - 1));
99
-            $this->query("UPDATE {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->pkName}` IN ({$ids})) ORDER BY `{$this->indexName}` ASC");
99
+            $this->query("update {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->pkName}` IN ({$ids})) ORDER BY `{$this->indexName}` ASC");
100 100
             $this->query("SET @index := -1");
101 101
         } else {
102 102
             $this->query("SET @index := -1");
103
-            $this->query("UPDATE {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->pkName}` IN ({$ids})) ORDER BY `{$this->indexName}` ASC");
103
+            $this->query("update {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->pkName}` IN ({$ids})) ORDER BY `{$this->indexName}` ASC");
104 104
             $this->query("SET @index := " . ($cnt - 1));
105 105
         }
106
-        $this->query("UPDATE {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->pkName}` NOT IN ({$ids})) AND `{$this->rfName}` = {$rid} ORDER BY `{$this->indexName}` ASC");
106
+        $this->query("update {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->pkName}` NOT IN ({$ids})) AND `{$this->rfName}` = {$rid} ORDER BY `{$this->indexName}` ASC");
107 107
         $out = $this->modx->db->getAffectedRows();
108 108
 
109 109
         return $out;
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php namespace SimpleTab;
2 2
 
3
-require_once(MODX_BASE_PATH . 'assets/lib/MODxAPI/autoTable.abstract.php');
4
-require_once(MODX_BASE_PATH . 'assets/lib/Helpers/FS.php');
5
-require_once(MODX_BASE_PATH . 'assets/lib/Helpers/PHPThumb.php');
3
+require_once(MODX_BASE_PATH.'assets/lib/MODxAPI/autoTable.abstract.php');
4
+require_once(MODX_BASE_PATH.'assets/lib/Helpers/FS.php');
5
+require_once(MODX_BASE_PATH.'assets/lib/Helpers/PHPThumb.php');
6 6
 
7 7
 /**
8 8
  * Class dataTable
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $rows = $this->query("SELECT MIN(`{$this->indexName}`) FROM {$table} WHERE `{$this->pkName}` IN ({$ids})");
60 60
         $index = $this->modx->db->getValue($rows);
61 61
         $index = $index - 1;
62
-        $this->query("SET @index := " . $index);
62
+        $this->query("SET @index := ".$index);
63 63
         $this->query("UPDATE {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->indexName}`>{$index} AND `{$this->rfName}`={$rid} AND `{$this->pkName}` NOT IN ({$ids})) ORDER BY `{$this->indexName}` ASC");
64 64
         $out = $this->modx->db->getAffectedRows();
65 65
 
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
         $cnt = count($ids);
95 95
         $ids = implode(',', $ids);
96 96
         if ($dir == 'top') {
97
-            $this->query("SET @index := " . ($index - $cnt - 1));
97
+            $this->query("SET @index := ".($index - $cnt - 1));
98 98
             $this->query("UPDATE {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->pkName}` IN ({$ids})) ORDER BY `{$this->indexName}` ASC");
99 99
             $this->query("SET @index := -1");
100 100
         } else {
101 101
             $this->query("SET @index := -1");
102 102
             $this->query("UPDATE {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->pkName}` IN ({$ids})) ORDER BY `{$this->indexName}` ASC");
103
-            $this->query("SET @index := " . ($cnt - 1));
103
+            $this->query("SET @index := ".($cnt - 1));
104 104
         }
105 105
         $this->query("UPDATE {$table} SET `{$this->indexName}` = (@index := @index + 1) WHERE (`{$this->pkName}` NOT IN ({$ids})) AND `{$this->rfName}` = {$rid} ORDER BY `{$this->indexName}` ASC");
106 106
         $out = $this->modx->db->getAffectedRows();
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             return;
120 120
         }
121 121
         if ($this->fs->checkFile($url)) {
122
-            unlink(MODX_BASE_PATH . $url);
122
+            unlink(MODX_BASE_PATH.$url);
123 123
         }
124 124
         $dir = $this->fs->takeFileDir($url);
125 125
         $iterator = new \FilesystemIterator($dir);
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
         if ($cache) {
130 130
             return;
131 131
         }
132
-        $thumbsCache = \APIhelpers::getkey($this->params,'thumbsCache',$this->thumbsCache);
133
-        $thumb = $thumbsCache . $url;
132
+        $thumbsCache = \APIhelpers::getkey($this->params, 'thumbsCache', $this->thumbsCache);
133
+        $thumb = $thumbsCache.$url;
134 134
         if ($this->fs->checkFile($thumb)) {
135 135
             $this->deleteThumb($thumb, true);
136 136
         }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         $filename = $this->fs->takeFileName($name);
184 184
         $ext = $this->fs->takeFileExt($name);
185 185
 
186
-        return $this->modx->stripAlias($filename) . '.' . $ext;
186
+        return $this->modx->stripAlias($filename).'.'.$ext;
187 187
     }
188 188
 
189 189
     /**
@@ -196,12 +196,12 @@  discard block
 block discarded – undo
196 196
      */
197 197
     public function reorder($source, $target, $point, $rid, $orderDir)
198 198
     {
199
-        $rid = (int)$rid;
199
+        $rid = (int) $rid;
200 200
         $point = strtolower($point);
201 201
         $orderDir = strtolower($orderDir);
202
-        $sourceIndex = (int)$source[$this->indexName];
203
-        $targetIndex = (int)$target[$this->indexName];
204
-        $sourceId = (int)$source[$this->pkName];
202
+        $sourceIndex = (int) $source[$this->indexName];
203
+        $targetIndex = (int) $target[$this->indexName];
204
+        $sourceId = (int) $source[$this->pkName];
205 205
         $table = $this->makeTable($this->table);
206 206
         $rows = 0;
207 207
         /* more refactoring  needed */
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
             return false;
247 247
         }
248 248
         $thumb = new \Helpers\PHPThumb();
249
-        $inputFile = MODX_BASE_PATH . $this->fs->relativePath($url);
250
-        $outputFile = MODX_BASE_PATH . $this->fs->relativePath($folder) . '/' . $this->fs->relativePath($url);
249
+        $inputFile = MODX_BASE_PATH.$this->fs->relativePath($url);
250
+        $outputFile = MODX_BASE_PATH.$this->fs->relativePath($folder).'/'.$this->fs->relativePath($url);
251 251
         $dir = $this->fs->takeFileDir($outputFile);
252 252
         $this->fs->makeDir($dir, $this->modx->config['new_folder_permissions']);
253 253
         if ($thumb->create($inputFile, $outputFile, $options)) {
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -272,6 +272,8 @@
 block discarded – undo
272 272
      */
273 273
     public function setParams($params = array())
274 274
     {
275
-        if (is_array($params)) $this->params = $params;
275
+        if (is_array($params)) {
276
+            $this->params = $params;
277
+        }
276 278
     }
277 279
 }
Please login to merge, or discard this patch.
assets/lib/MODxAPI/autoTable.abstract.php 3 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,10 +89,10 @@
 block discarded – undo
89 89
         }
90 90
         if (!empty($this->set)) {
91 91
             if ($this->newDoc) {
92
-                $SQL = "INSERT {$this->ignoreError} INTO {$this->makeTable($this->table)} SET " . implode(', ',
92
+                $SQL = "insert {$this->ignoreError} INTO {$this->makeTable($this->table)} SET " . implode(', ',
93 93
                         $this->set);
94 94
             } else {
95
-                $SQL = ($this->getID() === null) ? null : "UPDATE {$this->ignoreError} {$this->makeTable($this->table)} SET " . implode(', ',
95
+                $SQL = ($this->getID() === null) ? null : "update {$this->ignoreError} {$this->makeTable($this->table)} SET " . implode(', ',
96 96
                         $this->set) . " WHERE `" . $this->pkName . "` = " . $this->getID();
97 97
             }
98 98
             $this->query($SQL);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             $this->close();
57 57
             $this->markAllEncode();
58 58
             $this->newDoc = false;
59
-            $result = $this->query("SELECT * from {$this->makeTable($this->table)} where `" . $this->pkName . "`='" . $this->escape($id) . "'");
59
+            $result = $this->query("SELECT * from {$this->makeTable($this->table)} where `".$this->pkName."`='".$this->escape($id)."'");
60 60
             $this->fromArray($this->modx->db->getRow($result));
61 61
             $this->store($this->toArray());
62 62
             $this->id = $this->eraseField($this->pkName);
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
         }
98 98
         if (!empty($this->set)) {
99 99
             if ($this->newDoc) {
100
-                $SQL = "INSERT {$this->ignoreError} INTO {$this->makeTable($this->table)} SET " . implode(', ',
100
+                $SQL = "INSERT {$this->ignoreError} INTO {$this->makeTable($this->table)} SET ".implode(', ',
101 101
                         $this->set);
102 102
             } else {
103
-                $SQL = ($this->getID() === null) ? null : "UPDATE {$this->ignoreError} {$this->makeTable($this->table)} SET " . implode(', ',
104
-                        $this->set) . " WHERE `" . $this->pkName . "` = " . $this->getID();
103
+                $SQL = ($this->getID() === null) ? null : "UPDATE {$this->ignoreError} {$this->makeTable($this->table)} SET ".implode(', ',
104
+                        $this->set)." WHERE `".$this->pkName."` = ".$this->getID();
105 105
             }
106 106
             $this->query($SQL);
107 107
             if ($this->newDoc) {
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
         if (is_array($_ids) && $_ids != array()) {
129 129
             $id = $this->sanitarIn($_ids);
130 130
             if (!empty($id)) {
131
-                $this->query("DELETE from {$this->makeTable($this->table)} where `" . $this->pkName . "` IN ({$id})");
131
+                $this->query("DELETE from {$this->makeTable($this->table)} where `".$this->pkName."` IN ({$id})");
132 132
             }
133 133
             $this->clearCache($fire_events);
134 134
         } else {
135
-            throw new Exception('Invalid IDs list for delete: <pre>' . print_r($ids, 1) . '</pre>');
135
+            throw new Exception('Invalid IDs list for delete: <pre>'.print_r($ids, 1).'</pre>');
136 136
         }
137 137
 
138 138
         return $this;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,8 +80,7 @@
 block discarded – undo
80 80
         foreach ($this->jsonFields as $field) {
81 81
             if ($this->get($field) === null
82 82
                 && isset($this->default_field[$field])
83
-                && is_array($this->default_field[$field]))
84
-            {
83
+                && is_array($this->default_field[$field])) {
85 84
                 $this->set($field, $this->default_field[$field]);
86 85
             }
87 86
         }
Please login to merge, or discard this patch.
assets/lib/MODxAPI/modResource.php 3 patches
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
             if ($this->newDoc) {
591 591
                 $SQL = "INSERT into {$this->makeTable('site_content')} SET " . implode(', ', $this->set);
592 592
             } else {
593
-                $SQL = "UPDATE {$this->makeTable('site_content')} SET " . implode(', ',
593
+                $SQL = "update {$this->makeTable('site_content')} SET " . implode(', ',
594 594
                         $this->set) . " WHERE `id` = " . $this->id;
595 595
             }
596 596
             $this->query($SQL);
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
             }
601 601
 
602 602
             if ($parent > 0) {
603
-                $this->query("UPDATE {$this->makeTable('site_content')} SET `isfolder`='1' WHERE `id`='{$parent}'");
603
+                $this->query("update {$this->makeTable('site_content')} SET `isfolder`='1' WHERE `id`='{$parent}'");
604 604
             }
605 605
         }
606 606
 
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
             $id = $this->sanitarIn($_ids);
675 675
             $uid = (int)$this->modx->getLoginUserId();
676 676
             $deletedon = time() + $this->modxConfig('server_offset_time');
677
-            $this->query("UPDATE {$this->makeTable('site_content')} SET `deleted`=1, `deletedby`={$uid}, `deletedon`={$deletedon} WHERE `id` IN ({$id})");
677
+            $this->query("update {$this->makeTable('site_content')} SET `deleted`=1, `deletedby`={$uid}, `deletedon`={$deletedon} WHERE `id` IN ({$id})");
678 678
         } else {
679 679
             throw new Exception('Invalid IDs list for mark trash: <pre>' . print_r($ids,
680 680
                     1) . '</pre> please, check ignore list: <pre>' . print_r($ignore, 1) . '</pre>');
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
             $tbl_site_tmplvars = $this->makeTable('site_tmplvars');
868 868
             $fields = 'id,name,default_text as value,display,display_params,type';
869 869
             $implodeTvId = implode(',', $tvId);
870
-            $rs = $this->query("SELECT {$fields} FROM {$tbl_site_tmplvars} WHERE id IN({$implodeTvId})");
870
+            $rs = $this->query("select {$fields} FROM {$tbl_site_tmplvars} WHERE id IN({$implodeTvId})");
871 871
             $rows = $this->modx->db->makeArray($rs);
872 872
             $this->tvd = array();
873 873
             foreach ($rows as $item) {
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
                 $sql = "SELECT `id` FROM {$this->makeTable('site_templates')} WHERE `templatename` = '" . $this->escape($tpl) . "'";
891 891
                 $rs = $this->query($sql);
892 892
                 if (!$rs || $this->modx->db->getRecordCount($rs) <= 0) {
893
-                    throw new Exception("Template {$tpl} is not exists");
893
+                    throw new Exception("template {$tpl} is not exists");
894 894
                 }
895 895
                 $tpl = $this->modx->db->getValue($rs);
896 896
             } else {
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
         $dir = strtolower($dir) == 'desc' ? 'desc' : 'asc';
934 934
         if (is_integer($parent) && $criteria !== '') {
935 935
             $this->query("SET @index := 0");
936
-            $this->query("UPDATE {$this->makeTable('site_content')} SET `menuindex` = (@index := @index + 1) WHERE `parent`={$parent} ORDER BY {$criteria} {$dir}");
936
+            $this->query("update {$this->makeTable('site_content')} SET `menuindex` = (@index := @index + 1) WHERE `parent`={$parent} ORDER BY {$criteria} {$dir}");
937 937
         }
938 938
 
939 939
         return $this;
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $this->get_TV();
164 164
         $uTable = $this->makeTable("manager_users");
165 165
         $aTable = $this->makeTable("user_attributes");
166
-        $query = "SELECT `u`.`id`, `a`.`email`, `u`.`username`  FROM " . $aTable . " as `a` LEFT JOIN " . $uTable . " as `u` ON `u`.`id`=`a`.`internalKey`";
166
+        $query = "SELECT `u`.`id`, `a`.`email`, `u`.`username`  FROM ".$aTable." as `a` LEFT JOIN ".$uTable." as `u` ON `u`.`id`=`a`.`internalKey`";
167 167
         $query = $this->query($query);
168 168
         $this->managerUsers = new DLCollection($modx, empty($query) ? array() : $query);
169 169
     }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
     public function getUrl()
226 226
     {
227 227
         $out = null;
228
-        $id = (int)$this->getID();
228
+        $id = (int) $this->getID();
229 229
         if (!empty($id)) {
230 230
             $out = $this->modx->makeUrl($id);
231 231
         }
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
     {
279 279
         $out = null;
280 280
         if ($this->getID() > 0) {
281
-            include_once MODX_MANAGER_PATH . "includes/tmplvars.format.inc.php";
282
-            include_once MODX_MANAGER_PATH . "includes/tmplvars.commands.inc.php";
281
+            include_once MODX_MANAGER_PATH."includes/tmplvars.format.inc.php";
282
+            include_once MODX_MANAGER_PATH."includes/tmplvars.commands.inc.php";
283 283
             $tvval = $this->get($tvname);
284 284
             if ($this->isTVarrayField($tvname) && is_array($tvval)) {
285 285
                 $tvval = implode('||', $tvval);
@@ -323,14 +323,14 @@  discard block
 block discarded – undo
323 323
         if ((is_scalar($value) || $this->isTVarrayField($key) || $this->isJsonField($key)) && is_scalar($key) && !empty($key)) {
324 324
             switch ($key) {
325 325
                 case 'parent':
326
-                    $value = (int)$value;
326
+                    $value = (int) $value;
327 327
                     break;
328 328
                 case 'template':
329 329
                     $value = trim($value);
330 330
                     $value = $this->setTemplate($value);
331 331
                     break;
332 332
                 case 'published':
333
-                    $value = (int)((bool)$value);
333
+                    $value = (int) ((bool) $value);
334 334
                     if ($value) {
335 335
                         $this->field['publishedon'] = time() + $this->modxConfig('server_offset_time');
336 336
                     }
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
                     }
351 351
                     break;
352 352
                 case 'deleted':
353
-                    $value = (int)((bool)$value);
353
+                    $value = (int) ((bool) $value);
354 354
                     if ($value) {
355 355
                         $this->field['deletedon'] = time() + $this->modxConfig('server_offset_time');
356 356
                     } else {
@@ -392,11 +392,11 @@  discard block
 block discarded – undo
392 392
     protected function getUser($value, $default = 0)
393 393
     {
394 394
         $currentAdmin = APIHelpers::getkey($_SESSION, 'mgrInternalKey', 0);
395
-        $value = (int)$value;
395
+        $value = (int) $value;
396 396
         if (!empty($value)) {
397 397
             $by = $this->findUserBy($value);
398
-            $exists = $this->managerUsers->exists(function ($key, Helpers\Collection $val) use ($by, $value) {
399
-                return ($val->containsKey($by) && $val->get($by) === (string)$value);
398
+            $exists = $this->managerUsers->exists(function($key, Helpers\Collection $val) use ($by, $value) {
399
+                return ($val->containsKey($by) && $val->get($by) === (string) $value);
400 400
             });
401 401
             if (!$exists) {
402 402
                 $value = 0;
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
     protected function findUserBy($data)
417 417
     {
418 418
         switch (true) {
419
-            case (is_int($data) || ((int)$data > 0 && (string)intval($data) === $data)):
419
+            case (is_int($data) || ((int) $data > 0 && (string) intval($data) === $data)):
420 420
                 $find = 'id';
421 421
                 break;
422 422
             case filter_var($data, FILTER_VALIDATE_EMAIL):
@@ -466,9 +466,9 @@  discard block
 block discarded – undo
466 466
             $this->markAllEncode();
467 467
             $this->newDoc = false;
468 468
 
469
-            $result = $this->query("SELECT * from {$this->makeTable('site_content')} where `id`=" . (int)$id);
469
+            $result = $this->query("SELECT * from {$this->makeTable('site_content')} where `id`=".(int) $id);
470 470
             $this->fromArray($this->modx->db->getRow($result));
471
-            $result = $this->query("SELECT * from {$this->makeTable('site_tmplvar_contentvalues')} where `contentid`=" . (int)$id);
471
+            $result = $this->query("SELECT * from {$this->makeTable('site_tmplvar_contentvalues')} where `contentid`=".(int) $id);
472 472
             while ($row = $this->modx->db->getRow($result)) {
473 473
                 $this->field[$this->tvid[$row['tmplvarid']]] = $row['value'];
474 474
             }
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
     {
496 496
         $parent = null;
497 497
         if ($this->field['pagetitle'] == '') {
498
-            $this->log['emptyPagetitle'] = 'Pagetitle is empty in <pre>' . print_r($this->field, true) . '</pre>';
498
+            $this->log['emptyPagetitle'] = 'Pagetitle is empty in <pre>'.print_r($this->field, true).'</pre>';
499 499
 
500 500
             return false;
501 501
         }
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
             }
549 549
             switch (true) {
550 550
                 case $key == 'parent':
551
-                    $parent = (int)$this->get($key);
551
+                    $parent = (int) $this->get($key);
552 552
                     $q = $this->query("SELECT count(`id`) FROM {$this->makeTable('site_content')} WHERE `id`='{$parent}'");
553 553
                     if ($this->modx->db->getValue($q) != 1) {
554 554
                         $parent = 0;
@@ -567,10 +567,10 @@  discard block
 block discarded – undo
567 567
 
568 568
         if (!empty($this->set)) {
569 569
             if ($this->newDoc) {
570
-                $SQL = "INSERT into {$this->makeTable('site_content')} SET " . implode(', ', $this->set);
570
+                $SQL = "INSERT into {$this->makeTable('site_content')} SET ".implode(', ', $this->set);
571 571
             } else {
572
-                $SQL = "UPDATE {$this->makeTable('site_content')} SET " . implode(', ',
573
-                        $this->set) . " WHERE `id` = " . $this->id;
572
+                $SQL = "UPDATE {$this->makeTable('site_content')} SET ".implode(', ',
573
+                        $this->set)." WHERE `id` = ".$this->id;
574 574
             }
575 575
             $this->query($SQL);
576 576
 
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
      * @param $tvId
635 635
      * @return bool
636 636
      */
637
-    protected function belongsToTemplate($tvId) {
637
+    protected function belongsToTemplate($tvId){
638 638
         $template = $this->get('template');
639 639
 
640 640
         return isset($this->tvTpl[$template]) && in_array($tvId, $this->tvTpl[$template]);
@@ -651,12 +651,12 @@  discard block
 block discarded – undo
651 651
         $_ids = $this->cleanIDs($ids, ',', $ignore);
652 652
         if (is_array($_ids) && $_ids != array()) {
653 653
             $id = $this->sanitarIn($_ids);
654
-            $uid = (int)$this->modx->getLoginUserId();
654
+            $uid = (int) $this->modx->getLoginUserId();
655 655
             $deletedon = time() + $this->modxConfig('server_offset_time');
656 656
             $this->query("UPDATE {$this->makeTable('site_content')} SET `deleted`=1, `deletedby`={$uid}, `deletedon`={$deletedon} WHERE `id` IN ({$id})");
657 657
         } else {
658
-            throw new Exception('Invalid IDs list for mark trash: <pre>' . print_r($ids,
659
-                    1) . '</pre> please, check ignore list: <pre>' . print_r($ignore, 1) . '</pre>');
658
+            throw new Exception('Invalid IDs list for mark trash: <pre>'.print_r($ids,
659
+                    1).'</pre> please, check ignore list: <pre>'.print_r($ignore, 1).'</pre>');
660 660
         }
661 661
 
662 662
         return $this;
@@ -738,15 +738,15 @@  discard block
 block discarded – undo
738 738
     {
739 739
         $ignore = array(
740 740
             0, //empty document
741
-            (int)$this->modxConfig('site_start'),
742
-            (int)$this->modxConfig('error_page'),
743
-            (int)$this->modxConfig('unauthorized_page'),
744
-            (int)$this->modxConfig('site_unavailable_page')
741
+            (int) $this->modxConfig('site_start'),
742
+            (int) $this->modxConfig('error_page'),
743
+            (int) $this->modxConfig('unauthorized_page'),
744
+            (int) $this->modxConfig('site_unavailable_page')
745 745
         );
746 746
         $data = $this->query("SELECT DISTINCT setting_value FROM {$this->makeTable('web_user_settings')} WHERE `setting_name`='login_home' AND `setting_value`!=''");
747 747
         $data = $this->modx->db->makeArray($data);
748 748
         foreach ($data as $item) {
749
-            $ignore[] = (int)$item['setting_value'];
749
+            $ignore[] = (int) $item['setting_value'];
750 750
         }
751 751
 
752 752
         return array_unique($ignore);
@@ -769,9 +769,9 @@  discard block
 block discarded – undo
769 769
             }
770 770
             if (($flag && $this->newDoc) || (!$this->newDoc && $flag && $this->id != $flag)) {
771 771
                 $suffix = substr($alias, -2);
772
-                if (preg_match('/-(\d+)/', $suffix, $tmp) && isset($tmp[1]) && (int)$tmp[1] > 1) {
773
-                    $suffix = (int)$tmp[1] + 1;
774
-                    $alias = substr($alias, 0, -2) . '-' . $suffix;
772
+                if (preg_match('/-(\d+)/', $suffix, $tmp) && isset($tmp[1]) && (int) $tmp[1] > 1) {
773
+                    $suffix = (int) $tmp[1] + 1;
774
+                    $alias = substr($alias, 0, -2).'-'.$suffix;
775 775
                 } else {
776 776
                     $alias .= '-2';
777 777
                 }
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
     {
800 800
         $this->modx->_TVnames = array();
801 801
         if (empty($this->modx->_TVnames) || $reload) {
802
-            $result = $this->query('SELECT `id`,`name`,`type` FROM ' . $this->makeTable('site_tmplvars'));
802
+            $result = $this->query('SELECT `id`,`name`,`type` FROM '.$this->makeTable('site_tmplvars'));
803 803
             while ($row = $this->modx->db->GetRow($result)) {
804 804
                 $this->modx->_TVnames[$row['name']] = array(
805 805
                     "id"   => $row['id'],
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
      */
828 828
     protected function loadTVTemplate()
829 829
     {
830
-        $q = $this->query("SELECT `tmplvarid`, `templateid` FROM " . $this->makeTable('site_tmplvar_templates'));
830
+        $q = $this->query("SELECT `tmplvarid`, `templateid` FROM ".$this->makeTable('site_tmplvar_templates'));
831 831
         $q = $this->modx->db->makeArray($q);
832 832
         $this->tvTpl = array();
833 833
         foreach ($q as $item) {
@@ -865,20 +865,20 @@  discard block
 block discarded – undo
865 865
      */
866 866
     public function setTemplate($tpl)
867 867
     {
868
-        if (!is_numeric($tpl) || $tpl != (int)$tpl) {
868
+        if (!is_numeric($tpl) || $tpl != (int) $tpl) {
869 869
             if (is_scalar($tpl)) {
870
-                $sql = "SELECT `id` FROM {$this->makeTable('site_templates')} WHERE `templatename` = '" . $this->escape($tpl) . "'";
870
+                $sql = "SELECT `id` FROM {$this->makeTable('site_templates')} WHERE `templatename` = '".$this->escape($tpl)."'";
871 871
                 $rs = $this->query($sql);
872 872
                 if (!$rs || $this->modx->db->getRecordCount($rs) <= 0) {
873 873
                     throw new Exception("Template {$tpl} is not exists");
874 874
                 }
875 875
                 $tpl = $this->modx->db->getValue($rs);
876 876
             } else {
877
-                throw new Exception("Invalid template name: " . print_r($tpl, 1));
877
+                throw new Exception("Invalid template name: ".print_r($tpl, 1));
878 878
             }
879 879
         }
880 880
 
881
-        return (int)$tpl;
881
+        return (int) $tpl;
882 882
     }
883 883
 
884 884
     /**
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
         if ($this->isEncodableField($field)) {
1003 1003
             $data = $this->get($field);
1004 1004
             if ($this->isTVarrayField($field)) {
1005
-                $out = is_array($data) ? implode('||', $data) : (string)$data;
1005
+                $out = is_array($data) ? implode('||', $data) : (string) $data;
1006 1006
             } else {
1007 1007
                 $out = json_encode($data);
1008 1008
             }
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
     /**
1057 1057
      * @param int $docId
1058 1058
      */
1059
-    public function getDocumentGroups($docId = 0) {
1059
+    public function getDocumentGroups($docId = 0){
1060 1060
         $out = array();
1061 1061
         $doc = $this->switchObject($docId);
1062 1062
         if (null !== $doc->getID()) {
@@ -1064,7 +1064,7 @@  discard block
 block discarded – undo
1064 1064
             $docgroup_names = $this->makeTable('documentgroup_names');
1065 1065
 
1066 1066
             $rs = $this->query("SELECT `dg`.`document_group`, `dgn`.`name` FROM {$doc_groups} as `dg` INNER JOIN {$docgroup_names} as `dgn` ON `dgn`.`id`=`dg`.`document_group`
1067
-                WHERE `dg`.`document` = " . $doc->getID());
1067
+                WHERE `dg`.`document` = ".$doc->getID());
1068 1068
             while ($row = $this->modx->db->getRow($rs)) {
1069 1069
                 $out[$row['document_group']] = $row['name'];
1070 1070
             }
Please login to merge, or discard this patch.
Braces   +14 added lines, -6 removed lines patch added patch discarded remove patch
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
         $value = (int)$value;
396 396
         if (!empty($value)) {
397 397
             $by = $this->findUserBy($value);
398
-            $exists = $this->managerUsers->exists(function ($key, Helpers\Collection $val) use ($by, $value) {
398
+            $exists = $this->managerUsers->exists(function ($key, Helpers\Collection $val) use ($by, $value){
399 399
                 return ($val->containsKey($by) && $val->get($by) === (string)$value);
400 400
             });
401 401
             if (!$exists) {
@@ -614,7 +614,9 @@  discard block
 block discarded – undo
614 614
             $this->newDoc = false;
615 615
         }
616 616
 
617
-        if (!empty($this->groupIds)) $this->setDocumentGroups($this->id, $this->groupIds);
617
+        if (!empty($this->groupIds)) {
618
+            $this->setDocumentGroups($this->id, $this->groupIds);
619
+        }
618 620
         $this->invokeEvent('OnDocFormSave', array(
619 621
             'mode'   => $this->mode,
620 622
             'id'     => isset($this->id) ? $this->id : '',
@@ -634,7 +636,8 @@  discard block
 block discarded – undo
634 636
      * @param $tvId
635 637
      * @return bool
636 638
      */
637
-    protected function belongsToTemplate($tvId) {
639
+    protected function belongsToTemplate($tvId)
640
+    {
638 641
         $template = $this->get('template');
639 642
 
640 643
         return isset($this->tvTpl[$template]) && in_array($tvId, $this->tvTpl[$template]);
@@ -816,7 +819,9 @@  discard block
 block discarded – undo
816 819
                 $arrayTVs[] = $name;
817 820
             }
818 821
         }
819
-        if (empty($this->tvaFields)) $this->tvaFields = $arrayTVs;
822
+        if (empty($this->tvaFields)) {
823
+            $this->tvaFields = $arrayTVs;
824
+        }
820 825
         $this->loadTVTemplate()->loadTVDefault(array_values($this->tv));
821 826
 
822 827
         return $this;
@@ -1056,7 +1061,8 @@  discard block
 block discarded – undo
1056 1061
     /**
1057 1062
      * @param int $docId
1058 1063
      */
1059
-    public function getDocumentGroups($docId = 0) {
1064
+    public function getDocumentGroups($docId = 0)
1065
+    {
1060 1066
         $out = array();
1061 1067
         $doc = $this->switchObject($docId);
1062 1068
         if (null !== $doc->getID()) {
@@ -1082,7 +1088,9 @@  discard block
 block discarded – undo
1082 1088
      */
1083 1089
     public function setDocumentGroups($docId = 0, $groupIds = array())
1084 1090
     {
1085
-        if (!is_array($groupIds)) return $this;
1091
+        if (!is_array($groupIds)) {
1092
+            return $this;
1093
+        }
1086 1094
         if ($this->newDoc && $docId == 0) {
1087 1095
             $this->groupIds = $groupIds;
1088 1096
         } else {
Please login to merge, or discard this patch.