Completed
Push — master ( 5061b6...54eaec )
by Michael
12:20 queued 12:16
created
xoops_lib/Xoops/Core/Text/Sanitizer.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
     {
274 274
         $config = $this->getConfig();
275 275
 
276
-        foreach ((array) $config['prefilters'] as $filter) {
276
+        foreach ((array)$config['prefilters'] as $filter) {
277 277
             $text = $this->executeFilter($filter, $text);
278 278
         }
279 279
 
280
-        if (!(bool) $html) {
280
+        if (!(bool)$html) {
281 281
             // html not allowed, so escape any special chars
282 282
             // don't mess with quotes or shortcodes will fail
283 283
             $text = htmlspecialchars($text, ENT_NOQUOTES | ENT_SUBSTITUTE, 'UTF-8', false);
@@ -285,20 +285,20 @@  discard block
 block discarded – undo
285 285
 
286 286
         if ($xcode) {
287 287
             $text = $this->prefilterCodeBlocks($text);
288
-            $text = $this->xoopsCodeDecode($text, (bool) $image);
288
+            $text = $this->xoopsCodeDecode($text, (bool)$image);
289 289
         }
290
-        if ((bool) $smiley) {
290
+        if ((bool)$smiley) {
291 291
             // process smiley
292 292
             $text = $this->smiley($text);
293 293
         }
294
-        if ((bool) $br) {
294
+        if ((bool)$br) {
295 295
             $text = $this->nl2Br($text);
296 296
         }
297 297
         if ($xcode) {
298 298
             $text = $this->postfilterCodeBlocks($text);
299 299
         }
300 300
 
301
-        foreach ((array) $config['postfilters'] as $filter) {
301
+        foreach ((array)$config['postfilters'] as $filter) {
302 302
             $text = $this->executeFilter($filter, $text);
303 303
         }
304 304
 
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
         $patterns = "/\[code([^\]]*?)\](.*)\[\/code\]/sU";
368 368
         $text = preg_replace_callback(
369 369
             $patterns,
370
-            function ($matches) {
371
-                return '[code' . $matches[1] . ']' . base64_encode($matches[2]). '[/code]';
370
+            function($matches) {
371
+                return '[code'.$matches[1].']'.base64_encode($matches[2]).'[/code]';
372 372
             },
373 373
             $text
374 374
         );
@@ -388,13 +388,13 @@  discard block
 block discarded – undo
388 388
         $patterns = "/\[code([^\]]*?)\](.*)\[\/code\]/sU";
389 389
         $text = preg_replace_callback(
390 390
             $patterns,
391
-            function ($matches) {
392
-                return '<div class=\"xoopsCode\">' .
391
+            function($matches) {
392
+                return '<div class=\"xoopsCode\">'.
393 393
                 $this->executeFilter(
394 394
                     'syntaxhighlight',
395 395
                     str_replace('\\\"', '\"', base64_decode($matches[2])),
396 396
                     $matches[1]
397
-                ) . '</div>';
397
+                ).'</div>';
398 398
             },
399 399
             $text
400 400
         );
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
     {
412 412
         $list = [];
413 413
         foreach ($this->config as $name => $configs) {
414
-            if (((bool) $configs['enabled']) && $configs['type'] === 'extension') {
414
+            if (((bool)$configs['enabled']) && $configs['type'] === 'extension') {
415 415
                 $list[] = $name;
416 416
             }
417 417
         }
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
     {
625 625
         if ($this->config->has($name)) {
626 626
             $this->config[$name]['enabled'] = true;
627
-            if($this->extensionsLoaded) {
627
+            if ($this->extensionsLoaded) {
628 628
                 $this->extensionsLoaded = false;
629 629
             }
630 630
             $this->registerExtensions();
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Model/Sync.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
             || empty($this->handler->field_link)
70 70
         ) {
71 71
             trigger_error(
72
-                "The link information is not set for '" . get_class($this->handler) . "' yet.",
72
+                "The link information is not set for '".get_class($this->handler)."' yet.",
73 73
                 E_USER_WARNING
74 74
             );
75 75
             return false;
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Model/Write.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -66,21 +66,21 @@  discard block
 block discarded – undo
66 66
     {
67 67
         if (!(class_exists($this->handler->className) && $object instanceof $this->handler->className)) {
68 68
             trigger_error(
69
-                "Object '" . get_class($object) . "' is not an instance of '" . $this->handler->className . "'",
69
+                "Object '".get_class($object)."' is not an instance of '".$this->handler->className."'",
70 70
                 E_USER_NOTICE
71 71
             );
72 72
             return false;
73 73
         }
74 74
         if (!$object->isDirty()) {
75 75
             trigger_error(
76
-                "Data entry is not inserted - the object '" . get_class($object) . "' is not dirty",
76
+                "Data entry is not inserted - the object '".get_class($object)."' is not dirty",
77 77
                 E_USER_NOTICE
78 78
             );
79 79
             return false;
80 80
         }
81 81
         if (!$this->cleanVars($object)) {
82 82
             trigger_error(
83
-                "Insert failed in method 'cleanVars' of object '" . get_class($object) . "'" . $object->getHtmlErrors(),
83
+                "Insert failed in method 'cleanVars' of object '".get_class($object)."'".$object->getHtmlErrors(),
84 84
                 E_USER_WARNING
85 85
             );
86 86
             return false;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         if ($object->isNew()) {
90 90
             if (empty($object->cleanVars)) {
91 91
                 trigger_error(
92
-                    "Data entry is not inserted - no variable is changed in object of '" . get_class($object) . "'",
92
+                    "Data entry is not inserted - no variable is changed in object of '".get_class($object)."'",
93 93
                     E_USER_NOTICE
94 94
                 );
95 95
                 return false;
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     {
132 132
         if (!(class_exists($this->handler->className) && $object instanceof $this->handler->className)) {
133 133
             trigger_error(
134
-                "Object '" . get_class($object) . "' is not an instance of '" . $this->handler->className . "'",
134
+                "Object '".get_class($object)."' is not an instance of '".$this->handler->className."'",
135 135
                 E_USER_NOTICE
136 136
             );
137 137
             return false;
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Model/Joint.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 
91 91
         $qb = $this->handler->db2->createXoopsQueryBuilder();
92 92
         if (is_array($fields) && count($fields)) {
93
-            if (!in_array("o." . $this->handler->keyName, $fields)) {
94
-                $fields[] = "o." . $this->handler->keyName;
93
+            if (!in_array("o.".$this->handler->keyName, $fields)) {
94
+                $fields[] = "o.".$this->handler->keyName;
95 95
             }
96 96
             $first = true;
97 97
             foreach ($fields as $field) {
@@ -230,13 +230,13 @@  discard block
 block discarded – undo
230 230
 
231 231
         $set = array();
232 232
         foreach ($data as $key => $val) {
233
-            $set[] = "o.{$key}=" . $this->handler->db2->quote($val);
233
+            $set[] = "o.{$key}=".$this->handler->db2->quote($val);
234 234
         }
235
-        $sql = " UPDATE {$this->handler->table} AS o" . " SET " . implode(", ", $set)
235
+        $sql = " UPDATE {$this->handler->table} AS o"." SET ".implode(", ", $set)
236 236
             . " LEFT JOIN {$this->handler->table_link} AS l "
237 237
             . "ON o.{$this->handler->field_object} = l.{$this->handler->field_link}";
238 238
         if (isset($criteria) && ($criteria instanceof CriteriaElement)) {
239
-            $sql .= " " . $criteria->renderWhere();
239
+            $sql .= " ".$criteria->renderWhere();
240 240
         }
241 241
 
242 242
         return $this->handler->db2->executeUpdate($sql);
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
             . "LEFT JOIN {$this->handler->table_link} AS l "
266 266
             . "ON o.{$this->handler->field_object} = l.{$this->handler->field_link}";
267 267
         if (isset($criteria) && ($criteria instanceof CriteriaElement)) {
268
-            $sql .= " " . $criteria->renderWhere();
268
+            $sql .= " ".$criteria->renderWhere();
269 269
         }
270 270
 
271 271
         return $this->handler->db2->executeUpdate($sql);
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Model/Read.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
             if (!in_array($this->handler->keyName, $fields)) {
46 46
                 $fields[] = $this->handler->keyName;
47 47
             }
48
-            $first=true;
48
+            $first = true;
49 49
             foreach ($fields as $field) {
50 50
                 if ($first) {
51
-                    $first=false;
51
+                    $first = false;
52 52
                     $qb->select($field);
53 53
                 } else {
54 54
                     $qb->addSelect($field);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             $qb->addSelect($this->handler->identifierName);
132 132
         }
133 133
         $qb->from($this->handler->table, null);
134
-        if ($limit!=0 || $start!=0) {
134
+        if ($limit != 0 || $start != 0) {
135 135
             $qb->setFirstResult($start)
136 136
                 ->setMaxResults($limit);
137 137
         }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/XoopsPersistableObjectHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -240,10 +240,10 @@
 block discarded – undo
240 240
             if (!in_array($this->keyName, $fields)) {
241 241
                 $fields[] = $this->keyName;
242 242
             }
243
-            $first=true;
243
+            $first = true;
244 244
             foreach ($fields as $field) {
245 245
                 if ($first) {
246
-                    $first=false;
246
+                    $first = false;
247 247
                     $qb->select($field);
248 248
                 } else {
249 249
                     $qb->addSelect($field);
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Criteria.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function render()
80 80
     {
81
-        $clause = (!empty($this->prefix) ? "{$this->prefix}." : "") . $this->column;
81
+        $clause = (!empty($this->prefix) ? "{$this->prefix}." : "").$this->column;
82 82
         if (!empty($this->function)) {
83 83
             $clause = sprintf($this->function, $clause);
84 84
         }
85 85
         if (in_array(strtoupper($this->operator), array('IS NULL', 'IS NOT NULL'))) {
86
-            $clause .= ' ' . $this->operator;
86
+            $clause .= ' '.$this->operator;
87 87
         } else {
88 88
             if ('' === ($value = trim($this->value))) {
89 89
                 return '';
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
         if ($this->operator === '!=' || $this->operator === '<>') {
123 123
             $operator = '=';
124
-            $clause = "(!(" . $this->column . $operator . $this->value . "))";
124
+            $clause = "(!(".$this->column.$operator.$this->value."))";
125 125
         } else {
126 126
             if ($this->operator === 'IN') {
127 127
                 $newvalue = str_replace(array('(', ')'), '', $this->value);
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
                 foreach ($tab as $uid) {
130 130
                     $clause .= "({$this->column}={$uid})";
131 131
                 }
132
-                $clause = '(|' . $clause . ')';
132
+                $clause = '(|'.$clause.')';
133 133
             } else {
134
-                $clause = "(" . $this->column . ' ' . $this->operator . ' ' . $this->value . ")";
134
+                $clause = "(".$this->column.' '.$this->operator.' '.$this->value.")";
135 135
             }
136 136
         }
137 137
         return $clause;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      */
160 160
     public function renderQb(QueryBuilder $qb = null, $whereMode = '')
161 161
     {
162
-        if ($qb==null) { // initialize query builder if not passed in
162
+        if ($qb == null) { // initialize query builder if not passed in
163 163
             $qb = \Xoops::getInstance()->db()->createXoopsQueryBuilder();
164 164
             $whereMode = ''; // first entry in new instance must be where
165 165
         }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                 break;
178 178
         }
179 179
 
180
-        if ($this->limit!=0 || $this->start!=0) {
180
+        if ($this->limit != 0 || $this->start != 0) {
181 181
             $qb->setFirstResult($this->start)
182 182
                 ->setMaxResults($this->limit);
183 183
         }
@@ -209,14 +209,14 @@  discard block
 block discarded – undo
209 209
     {
210 210
         $eb = $qb->expr();
211 211
 
212
-        $column = (empty($this->prefix) ? "" : $this->prefix.'.') . $this->column;
212
+        $column = (empty($this->prefix) ? "" : $this->prefix.'.').$this->column;
213 213
 
214 214
         // this should be done using portability functions
215 215
         if (!empty($this->function)) {
216 216
             $column = sprintf($this->function, $column);
217 217
         }
218 218
 
219
-        $value=trim($this->value);
219
+        $value = trim($this->value);
220 220
 
221 221
         $operator = strtolower($this->operator);
222 222
         $expr = '';
@@ -231,16 +231,16 @@  discard block
 block discarded – undo
231 231
                     $expr = $eb->isNotNull($column);
232 232
                     break;
233 233
                 case 'in':
234
-                    if (!empty($value) && $value!=='()') {
235
-                        $expr = $column . ' IN ' . $value;
234
+                    if (!empty($value) && $value !== '()') {
235
+                        $expr = $column.' IN '.$value;
236 236
                     } else {
237 237
                         // odd case of a null set - this won't match anything
238 238
                         $expr = $eb->neq($column, $column);
239 239
                     }
240 240
                     break;
241 241
                 case 'not in':
242
-                    if (!empty($value) && $value!=='()') {
243
-                        $expr = $column . ' NOT IN ' . $value;
242
+                    if (!empty($value) && $value !== '()') {
243
+                        $expr = $column.' NOT IN '.$value;
244 244
                     }
245 245
                     break;
246 246
             }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Dtype/DtypeDateTime.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
         } elseif (is_string($value)) {
71 71
             $cleanValue = strtotime($value);
72 72
         } else {
73
-            $cleanValue = (int) $value;
73
+            $cleanValue = (int)$value;
74 74
         }
75 75
         return $cleanValue;
76 76
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Dtype/DtypeJson.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@
 block discarded – undo
61 61
     public function cleanVar(XoopsObject $obj, $key)
62 62
     {
63 63
         $value = $obj->vars[$key]['value'];
64
-        $value = ($value===null || $value==='' || $value===false) ? null : $value;
65
-        if ($value!==null && null === json_decode($value, true)) {
64
+        $value = ($value === null || $value === '' || $value === false) ? null : $value;
65
+        if ($value !== null && null === json_decode($value, true)) {
66 66
             $value = json_encode($value, JSON_FORCE_OBJECT);
67
-            if ($value===false) {
67
+            if ($value === false) {
68 68
                 \Xoops::getInstance()->logger()->warning(
69 69
                     sprintf('Failed to encode to JSON - %s', json_last_error_msg())
70 70
                 );
Please login to merge, or discard this patch.