Completed
Pull Request — master (#616)
by Richard
13:56
created
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.
xoops_lib/Xoops/Core/Kernel/Dtype/DtypeMoney.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,6 +93,6 @@
 block discarded – undo
93 93
         if (false === $decoded || !(isset($decoded['amount']) && isset($decoded['currency']))) {
94 94
             return null;
95 95
         }
96
-        return new Money((int) $decoded['amount'], new Currency($decoded['currency']));
96
+        return new Money((int)$decoded['amount'], new Currency($decoded['currency']));
97 97
     }
98 98
 }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Dtype/DtypeUrl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
             return $value;
43 43
         }
44 44
         if ($value != '' && !preg_match("/^http[s]*:\/\//i", $value)) {
45
-            $value = 'http://' . $value;
45
+            $value = 'http://'.$value;
46 46
         }
47 47
         return $value;
48 48
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Dtype/DtypeAbstract.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
      * @param string      $format Dtype::FORMAT_* constant indicating desired formatting
69 69
      *
70 70
      * @return mixed
71
-    */
71
+     */
72 72
     public function getVar(XoopsObject $obj, $key, $format)
73 73
     {
74 74
         $value = $obj->vars[$key]['value'];
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Handlers/XoopsOnlineHandler.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,9 +72,9 @@
 block discarded – undo
72 72
         $rows = $this->db2->updatePrefix(
73 73
             'system_online',
74 74
             array(
75
-               'online_uname'   => $uname,
76
-               'online_updated' => $time,
77
-               'online_module'  => $module,
75
+                'online_uname'   => $uname,
76
+                'online_updated' => $time,
77
+                'online_module'  => $module,
78 78
             ),
79 79
             $criteria
80 80
         );
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
         if ($rows === false) {
97 97
             return false;
98 98
         }
99
-        return ($rows>0);
99
+        return ($rows > 0);
100 100
     }
101 101
 
102 102
     /**
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Handlers/XoopsBlock.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
                 return false;
415 415
             }
416 416
             $funcFile = $xoops->path(
417
-                'modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file')
417
+                'modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file')
418 418
             );
419 419
             if (\XoopsLoad::fileExists($funcFile)) {
420 420
                 $xoops->loadLanguage('blocks', $this->getVar('dirname'));
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
             }
469 469
             if (!\XoopsLoad::fileExists(
470 470
                 $func_file = $xoops->path(
471
-                    'modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file')
471
+                    'modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file')
472 472
                 )
473 473
             )) {
474 474
                 return false;
Please login to merge, or discard this patch.