Completed
Pull Request — master (#616)
by Richard
13:56
created
xoops_lib/Xoops/Core/Kernel/Handlers/XoopsModule.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@
 block discarded – undo
44 44
      */
45 45
     public $adminmenu;
46 46
     /**
47
-    *
48
-    * @var array
49
-    */
47
+     *
48
+     * @var array
49
+     */
50 50
     private $internalMessages = array();
51 51
 
52 52
     protected $xoops_url;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
         $this->setVar('version', (int)(100 * ($this->modinfo['version'] + 0.001)));
106 106
         $this->setVar('dirname', $this->modinfo['dirname']);
107 107
 
108
-        $this->setVar('hasmain', (bool) $modInfoArray->get('hasMain', false));
109
-        $this->setVar('hasadmin', (bool) $modInfoArray->get('hasAdmin', false));
110
-        $this->setVar('hassearch', (bool) $modInfoArray->get('hasSearch', false));
111
-        $this->setVar('hasconfig', ($modInfoArray->has('config') && is_array($modInfoArray->get('config'))) || (bool) $modInfoArray->get('hascomments', false));
112
-        $this->setVar('hascomments', (bool) $modInfoArray->get('hasComments', false));
113
-        $this->setVar('hasnotification', (bool) $modInfoArray->get('hasNotification', false));
108
+        $this->setVar('hasmain', (bool)$modInfoArray->get('hasMain', false));
109
+        $this->setVar('hasadmin', (bool)$modInfoArray->get('hasAdmin', false));
110
+        $this->setVar('hassearch', (bool)$modInfoArray->get('hasSearch', false));
111
+        $this->setVar('hasconfig', ($modInfoArray->has('config') && is_array($modInfoArray->get('config'))) || (bool)$modInfoArray->get('hascomments', false));
112
+        $this->setVar('hascomments', (bool)$modInfoArray->get('hasComments', false));
113
+        $this->setVar('hasnotification', (bool)$modInfoArray->get('hasNotification', false));
114 114
         $this->setVar('namespace', $modInfoArray->get('namespace'));
115 115
         $this->setVar('category', $modInfoArray->get('category'));
116 116
     }
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
     public function mainLink()
186 186
     {
187 187
         if ($this->getVar('hasmain') == 1) {
188
-            $ret = '<a href="' . $this->xoops_url . '/modules/' . $this->getVar('dirname') . '/">'
189
-                . $this->getVar('name') . '</a>';
188
+            $ret = '<a href="'.$this->xoops_url.'/modules/'.$this->getVar('dirname').'/">'
189
+                . $this->getVar('name').'</a>';
190 190
             return $ret;
191 191
         }
192 192
         return false;
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         if ($this->getInfo('sub') && is_array($this->getInfo('sub'))) {
204 204
             foreach ($this->getInfo('sub') as $submenu) {
205 205
                 $ret[] = array(
206
-                    'name' => $submenu['name'] ,
206
+                    'name' => $submenu['name'],
207 207
                     'url' => $submenu['url']);
208 208
             }
209 209
         }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      */
218 218
     public function loadAdminMenu()
219 219
     {
220
-        $file = $this->xoops_root_path . '/modules/' . $this->getInfo('dirname') . '/' . $this->getInfo('adminmenu');
220
+        $file = $this->xoops_root_path.'/modules/'.$this->getInfo('dirname').'/'.$this->getInfo('adminmenu');
221 221
         if ($this->getInfo('adminmenu') && $this->getInfo('adminmenu') != '' && \XoopsLoad::fileExists($file)) {
222 222
             $adminmenu = array();
223 223
             include $file;
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         $xoops->loadLanguage('modinfo', $dirname);
265 265
         $xoops->loadLocale($dirname);
266 266
 
267
-        if (!\XoopsLoad::fileExists($file = $xoops->path('modules/' . $dirname . '/xoops_version.php'))) {
267
+        if (!\XoopsLoad::fileExists($file = $xoops->path('modules/'.$dirname.'/xoops_version.php'))) {
268 268
             if (false != $verbose) {
269 269
                 echo "Module File for $dirname Not Found!";
270 270
             }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/XoopsObject.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -20,20 +20,20 @@  discard block
 block discarded – undo
20 20
  *
21 21
  * These will eventually be removed. See Xoops\Core\Kernel\Dtype for more.
22 22
  */
23
-define('XOBJ_DTYPE_TXTBOX',  Dtype::TYPE_TEXT_BOX);
23
+define('XOBJ_DTYPE_TXTBOX', Dtype::TYPE_TEXT_BOX);
24 24
 define('XOBJ_DTYPE_TXTAREA', Dtype::TYPE_TEXT_AREA);
25
-define('XOBJ_DTYPE_INT',     Dtype::TYPE_INTEGER);
26
-define('XOBJ_DTYPE_URL',     Dtype::TYPE_URL);
27
-define('XOBJ_DTYPE_EMAIL',   Dtype::TYPE_EMAIL);
28
-define('XOBJ_DTYPE_ARRAY',   Dtype::TYPE_ARRAY);
29
-define('XOBJ_DTYPE_OTHER',   Dtype::TYPE_OTHER);
30
-define('XOBJ_DTYPE_SOURCE',  Dtype::TYPE_SOURCE);
31
-define('XOBJ_DTYPE_STIME',   Dtype::TYPE_SHORT_TIME);
32
-define('XOBJ_DTYPE_MTIME',   Dtype::TYPE_MEDIUM_TIME);
33
-define('XOBJ_DTYPE_LTIME',   Dtype::TYPE_LONG_TIME);
34
-define('XOBJ_DTYPE_FLOAT',   Dtype::TYPE_FLOAT);
25
+define('XOBJ_DTYPE_INT', Dtype::TYPE_INTEGER);
26
+define('XOBJ_DTYPE_URL', Dtype::TYPE_URL);
27
+define('XOBJ_DTYPE_EMAIL', Dtype::TYPE_EMAIL);
28
+define('XOBJ_DTYPE_ARRAY', Dtype::TYPE_ARRAY);
29
+define('XOBJ_DTYPE_OTHER', Dtype::TYPE_OTHER);
30
+define('XOBJ_DTYPE_SOURCE', Dtype::TYPE_SOURCE);
31
+define('XOBJ_DTYPE_STIME', Dtype::TYPE_SHORT_TIME);
32
+define('XOBJ_DTYPE_MTIME', Dtype::TYPE_MEDIUM_TIME);
33
+define('XOBJ_DTYPE_LTIME', Dtype::TYPE_LONG_TIME);
34
+define('XOBJ_DTYPE_FLOAT', Dtype::TYPE_FLOAT);
35 35
 define('XOBJ_DTYPE_DECIMAL', Dtype::TYPE_DECIMAL);
36
-define('XOBJ_DTYPE_ENUM',    Dtype::TYPE_ENUM);
36
+define('XOBJ_DTYPE_ENUM', Dtype::TYPE_ENUM);
37 37
 
38 38
 /**
39 39
  * Base class for all objects in the Xoops kernel (and beyond)
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         $ret = '<h4>Errors</h4>';
440 440
         if (!empty($this->errors)) {
441 441
             foreach ($this->errors as $error) {
442
-                $ret .= $error . '<br />';
442
+                $ret .= $error.'<br />';
443 443
             }
444 444
         } else {
445 445
             $ret .= 'None<br />';
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/Dtype.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
     /**
31 31
      * format constants used for getVar()
32 32
      */
33
-    const FORMAT_SHOW          = 'show';        // shorthand 's'
34
-    const FORMAT_EDIT          = 'edit';        // shorthand 'e'
35
-    const FORMAT_PREVIEW       = 'preview';     // shorthand 'p'
33
+    const FORMAT_SHOW          = 'show'; // shorthand 's'
34
+    const FORMAT_EDIT          = 'edit'; // shorthand 'e'
35
+    const FORMAT_PREVIEW       = 'preview'; // shorthand 'p'
36 36
     const FORMAT_FORM_PREVIEW = 'formpreview'; // shorthand 'f'
37
-    const FORMAT_NONE          = 'none';        // shorthand 'n'
37
+    const FORMAT_NONE          = 'none'; // shorthand 'n'
38 38
 
39 39
     /**
40 40
      * Xoops object datatype
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
         $dtype = null;
106 106
         if (!isset($dtypes[$name])) {
107
-            $className = 'Xoops\Core\Kernel\Dtype\\' . $name;
107
+            $className = 'Xoops\Core\Kernel\Dtype\\'.$name;
108 108
             $dtype = new $className();
109 109
             if (!$dtype instanceof DtypeAbstract) {
110 110
                 trigger_error("Dtype '{$name}' not found", E_USER_WARNING);
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/CriteriaCompo.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
                 if (!$render = $element->render()) {
90 90
                     continue;
91 91
                 }
92
-                $ret .= ' ' . $this->conditions[$i] . ' (' . $render . ')';
92
+                $ret .= ' '.$this->conditions[$i].' ('.$render.')';
93 93
             }
94 94
             $ret = "({$ret})";
95 95
         }
96
-        $ret = ($ret==='()') ? '(1)' : $ret;
96
+        $ret = ($ret === '()') ? '(1)' : $ret;
97 97
         return $ret;
98 98
     }
99 99
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     public function renderWhere()
106 106
     {
107 107
         $ret = $this->render();
108
-        $ret = ($ret != '') ? 'WHERE ' . $ret : $ret;
108
+        $ret = ($ret != '') ? 'WHERE '.$ret : $ret;
109 109
         return $ret;
110 110
     }
111 111
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             } else {
126 126
                 $cond = strtoupper($this->conditions[$i]);
127 127
                 $op = ($cond === "OR") ? "|" : "&";
128
-                $ret = "({$op}{$ret}" . $element->renderLdap() . ")";
128
+                $ret = "({$op}{$ret}".$element->renderLdap().")";
129 129
             }
130 130
         }
131 131
         return $ret;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function renderQb(QueryBuilder $qb = null, $whereMode = '')
144 144
     {
145
-        if ($qb==null) {
145
+        if ($qb == null) {
146 146
             $qb = \Xoops::getInstance()->db()->createXoopsQueryBuilder();
147 147
             $whereMode = ''; // first entry in new instance must be where
148 148
         }
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
                 if ($i == 0) {
155 155
                     $expr = $expr_part;
156 156
                 } else {
157
-                    $expr .= ' ' . strtoupper($this->conditions[$i]) . ' ' . $expr_part;
157
+                    $expr .= ' '.strtoupper($this->conditions[$i]).' '.$expr_part;
158 158
                 }
159 159
             }
160 160
         }
161 161
 
162 162
         if (!empty($expr)) {
163
-            $expr = '(' . $expr . ')'; // group all conditions in this compo
163
+            $expr = '('.$expr.')'; // group all conditions in this compo
164 164
 
165 165
             switch (strtolower($whereMode)) {
166 166
                 case 'and':
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             }
176 176
         }
177 177
 
178
-        if ($this->limit!=0 || $this->start!=0) {
178
+        if ($this->limit != 0 || $this->start != 0) {
179 179
             $qb->setFirstResult($this->start)
180 180
                 ->setMaxResults($this->limit);
181 181
         }
@@ -211,13 +211,13 @@  discard block
 block discarded – undo
211 211
                 if ($i == 0) {
212 212
                     $expr = $expr_part;
213 213
                 } else {
214
-                    $expr .= ' ' . strtoupper($this->conditions[$i]) . ' ' . $expr_part;
214
+                    $expr .= ' '.strtoupper($this->conditions[$i]).' '.$expr_part;
215 215
                 }
216 216
             }
217 217
         }
218 218
 
219 219
         if (!empty($expr)) {
220
-            $expr = '(' . $expr . ')'; // group all conditions in this compo
220
+            $expr = '('.$expr.')'; // group all conditions in this compo
221 221
         }
222 222
         return $expr;
223 223
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Kernel/XoopsModelFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,10 +58,10 @@
 block discarded – undo
58 58
     {
59 59
         if (!isset(self::$handlers[$name])) {
60 60
             $handler = null;
61
-            $className = '\Xoops\Core\Kernel\Model\\' . ucfirst($name);
61
+            $className = '\Xoops\Core\Kernel\Model\\'.ucfirst($name);
62 62
             @$handler = new $className();
63 63
             if (!is_object($handler)) {
64
-                trigger_error('Handler ' . $className . ' not found in file ' . __FILE__, E_USER_WARNING);
64
+                trigger_error('Handler '.$className.' not found in file '.__FILE__, E_USER_WARNING);
65 65
                 return null;
66 66
             }
67 67
             self::$handlers[$name] = $handler;
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Psr4ClassLoader.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -225,8 +225,8 @@
 block discarded – undo
225 225
             // replace namespace separators with directory separators
226 226
             // in the relative class name, append with .php
227 227
             $file = $base_dir
228
-                  . str_replace('\\', '/', $relative_class)
229
-                  . '.php';
228
+                    . str_replace('\\', '/', $relative_class)
229
+                    . '.php';
230 230
 
231 231
             // if the mapped file exists, require it
232 232
             if ($this->requireFile($file)) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -147,11 +147,11 @@
 block discarded – undo
147 147
     public function addNamespace($prefix, $base_dir, $prepend = false)
148 148
     {
149 149
         // normalize namespace prefix
150
-        $prefix = trim($prefix, '\\') . '\\';
150
+        $prefix = trim($prefix, '\\').'\\';
151 151
 
152 152
         // normalize the base directory with a trailing separator
153
-        $base_dir = rtrim($base_dir, '/') . DIRECTORY_SEPARATOR;
154
-        $base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR) . '/';
153
+        $base_dir = rtrim($base_dir, '/').DIRECTORY_SEPARATOR;
154
+        $base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR).'/';
155 155
 
156 156
         // initialize the namespace prefix array
157 157
         if (isset($this->prefixes[$prefix]) === false) {
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Psr0ClassLoader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -179,11 +179,11 @@
 block discarded – undo
179 179
                     $this->namespaceSeparator,
180 180
                     DIRECTORY_SEPARATOR,
181 181
                     $namespace
182
-                ) . DIRECTORY_SEPARATOR;
182
+                ).DIRECTORY_SEPARATOR;
183 183
             }
184
-            $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->fileExtension;
184
+            $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className).$this->fileExtension;
185 185
 
186
-            $absolute = ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '') . $fileName;
186
+            $absolute = ($this->includePath !== null ? $this->includePath.DIRECTORY_SEPARATOR : '').$fileName;
187 187
             if (file_exists($absolute)) {
188 188
                 require $absolute;
189 189
             }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Events.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
             $modules_list = \Xoops::getInstance()->getActiveModules();
102 102
             if (empty($modules_list)) {
103 103
                 // this should only happen if an exception was thrown in setActiveModules()
104
-                $modules_list = array ('system');
104
+                $modules_list = array('system');
105 105
             }
106
-            $this->preloadList =array();
106
+            $this->preloadList = array();
107 107
             $i = 0;
108 108
             foreach ($modules_list as $module) {
109
-                if (is_dir($dir = \XoopsBaseConfig::get('root-path') . "/modules/{$module}/preloads/")) {
109
+                if (is_dir($dir = \XoopsBaseConfig::get('root-path')."/modules/{$module}/preloads/")) {
110 110
                     $file_list = Lists\File::getList($dir);
111 111
                     foreach ($file_list as $file) {
112 112
                         if (preg_match('/(\.php)$/i', $file)) {
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
     {
151 151
         $xoops = \Xoops::getInstance();
152 152
         foreach ($this->preloadList as $preload) {
153
-            $path = $xoops->path('modules/' . $preload['module'] . '/preloads/' . $preload['file']. '.php');
153
+            $path = $xoops->path('modules/'.$preload['module'].'/preloads/'.$preload['file'].'.php');
154 154
             include_once $path;
155 155
             $class_name = ucfirst($preload['module'])
156
-                . ($preload['file'] === 'preload' ? '' : ucfirst($preload['file']) )
156
+                . ($preload['file'] === 'preload' ? '' : ucfirst($preload['file']))
157 157
                 . 'Preload';
158 158
             if (!class_exists($class_name)) {
159 159
                 continue;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     public function addListener($eventName, $callback)
216 216
     {
217 217
         $eventName = $this->toInternalEventName($eventName);
218
-        $this->eventListeners[$eventName][]=$callback;
218
+        $this->eventListeners[$eventName][] = $callback;
219 219
     }
220 220
 
221 221
     /**
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Theme/Factory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
             }
78 78
             $xoops->setConfig('theme_set', $options['folderName']);
79 79
         }
80
-        $options['path'] = \XoopsBaseConfig::get('themes-path') . '/' . $options['folderName'];
80
+        $options['path'] = \XoopsBaseConfig::get('themes-path').'/'.$options['folderName'];
81 81
         $inst = new XoopsTheme();
82 82
         foreach ($options as $k => $v) {
83 83
             $inst->$k = $v;
Please login to merge, or discard this patch.