Passed
Pull Request — master (#585)
by
unknown
17:41
created
xoops_lib/Xmf/Yaml.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@
 block discarded – undo
134 134
     {
135 135
         try {
136 136
             $yamlString = VendorYaml::dump($var, $inline, $indent);
137
-            $ret = empty($yamlString) ? false : "<?php\n/*\n---\n" . $yamlString . "\n...\n*/\n";
137
+            $ret = empty($yamlString) ? false : "<?php\n/*\n---\n".$yamlString."\n...\n*/\n";
138 138
         } catch (\Exception $e) {
139 139
             static::logError($e);
140 140
             $ret = false;
Please login to merge, or discard this patch.
xoops_lib/Xoops.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -141,14 +141,14 @@  discard block
 block discarded – undo
141 141
 
142 142
         $this->paths['www'] = array($root, $url);
143 143
         $this->paths['var'] = array($var, null);
144
-        $this->paths['lib'] = array($lib, $url . '/browse.php');
145
-        $this->paths['XOOPS'] = array($lib, $url . '/browse.php');
144
+        $this->paths['lib'] = array($lib, $url.'/browse.php');
145
+        $this->paths['XOOPS'] = array($lib, $url.'/browse.php');
146 146
         $this->paths['assets'] = array(\XoopsBaseConfig::get('asset-path'), \XoopsBaseConfig::get('asset-url'));
147
-        $this->paths['images'] = array($root . '/images', $url . '/images');
148
-        $this->paths['language'] = array($root . '/language', $url . '/language');
149
-        $this->paths['locale'] = array($root . '/locale', $url . '/locale');
147
+        $this->paths['images'] = array($root.'/images', $url.'/images');
148
+        $this->paths['language'] = array($root.'/language', $url.'/language');
149
+        $this->paths['locale'] = array($root.'/locale', $url.'/locale');
150 150
         $this->paths['media'] = array(\XoopsBaseConfig::get('media-path'), \XoopsBaseConfig::get('media-url'));
151
-        $this->paths['modules'] = array($root . '/modules', $url . '/modules');
151
+        $this->paths['modules'] = array($root.'/modules', $url.'/modules');
152 152
         $this->paths['themes'] = array(\XoopsBaseConfig::get('themes-path'), \XoopsBaseConfig::get('themes-url'));
153 153
         $this->paths['uploads'] = array(\XoopsBaseConfig::get('uploads-path'), \XoopsBaseConfig::get('uploads-url'));
154 154
 
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
     public function path($url, $virtual = false)
372 372
     {
373 373
         $url = $this->normalizePath($url);
374
-        $rootPath = $this->normalizePath(\XoopsBaseConfig::get('root-path') . '/');
374
+        $rootPath = $this->normalizePath(\XoopsBaseConfig::get('root-path').'/');
375 375
         if (0 === strpos($url, $rootPath)) {
376 376
             $url = substr($url, strlen($rootPath));
377 377
         }
@@ -383,11 +383,11 @@  discard block
 block discarded – undo
383 383
             list($root, $path) = array('www', $url);
384 384
         }
385 385
         if (!$virtual) { // Returns a physical path
386
-            $path = $this->paths[$root][0] . '/' . $path;
386
+            $path = $this->paths[$root][0].'/'.$path;
387 387
             //$path = str_replace('/', DIRECTORY_SEPARATOR, $path);
388 388
             return $path;
389 389
         }
390
-        return !isset($this->paths[$root][1]) ? '' : ($this->paths[$root][1] . '/' . $path);
390
+        return !isset($this->paths[$root][1]) ? '' : ($this->paths[$root][1].'/'.$path);
391 391
     }
392 392
 
393 393
     /**
@@ -435,9 +435,9 @@  discard block
 block discarded – undo
435 435
         }
436 436
         if (!empty($params)) {
437 437
             foreach ($params as $k => $v) {
438
-                $params[$k] = $k . '=' . rawurlencode($v);
438
+                $params[$k] = $k.'='.rawurlencode($v);
439 439
             }
440
-            $url .= '?' . implode('&', $params);
440
+            $url .= '?'.implode('&', $params);
441 441
         }
442 442
         return $url;
443 443
     }
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
                 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
519 519
             }
520 520
             if (isset($_SERVER['QUERY_STRING'])) {
521
-                $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
521
+                $_SERVER['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
522 522
             }
523 523
         }
524 524
     }
@@ -558,18 +558,18 @@  discard block
 block discarded – undo
558 558
         if ($matched) {
559 559
             $names = array('tpl_name', 'type', 'module', 'file');
560 560
             $ret = array();
561
-            for ($i=0; $i<4; ++$i) {
561
+            for ($i = 0; $i < 4; ++$i) {
562 562
                 $ret[$names[$i]] = $parts[$i];
563 563
             }
564 564
         } else {
565 565
             // this should be eliminated
566
-            $this->events()->triggerEvent('debug.log', "Sloppy template: " . $tpl_name);
566
+            $this->events()->triggerEvent('debug.log', "Sloppy template: ".$tpl_name);
567 567
             $ret = array();
568 568
             $ret['type'] = $this->isAdminSide ? 'admin' : 'module';
569 569
             $info = explode(':', $tpl_name);
570 570
             if (count($info) == 2) {
571 571
                 $ret['type'] = $info[0];
572
-                $tpl_name = str_replace($ret['type'] . ':', '', $tpl_name);
572
+                $tpl_name = str_replace($ret['type'].':', '', $tpl_name);
573 573
             }
574 574
 
575 575
             if ($ret['type'] === 'db') {
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
                     $ret['module'] = $this->module->getVar('dirname', 'n');
589 589
                 }
590 590
             }
591
-            $ret['tpl_name'] = $ret['type'] . ':' . $ret['module'] . '/' . $ret['file'];
591
+            $ret['tpl_name'] = $ret['type'].':'.$ret['module'].'/'.$ret['file'];
592 592
         }
593 593
 
594 594
         return $ret;
@@ -633,8 +633,8 @@  discard block
 block discarded – undo
633 633
                 $smarty = $repeat = null;
634 634
                 $this->theme()->headContent(
635 635
                     null,
636
-                    "<base href='" . \XoopsBaseConfig::get('url') . '/modules/'
637
-                    . $this->getConfig('startpage') . "/' />",
636
+                    "<base href='".\XoopsBaseConfig::get('url').'/modules/'
637
+                    . $this->getConfig('startpage')."/' />",
638 638
                     $smarty,
639 639
                     $repeat
640 640
                 );
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
         $this->events()->triggerEvent('core.footer.start');
682 682
 
683 683
         if (!headers_sent()) {
684
-            header('Content-Type:text/html; charset=' . XoopsLocale::getCharset());
684
+            header('Content-Type:text/html; charset='.XoopsLocale::getCharset());
685 685
             header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
686 686
             header('Cache-Control: private, no-cache');
687 687
             header('Pragma: no-cache');
@@ -1009,10 +1009,10 @@  discard block
 block discarded – undo
1009 1009
             }
1010 1010
         }
1011 1011
         if (XoopsLoad::fileExists(
1012
-            $hnd_file = \XoopsBaseConfig::get('root-path') . "/modules/{$module_dir}/class/form/{$name}.php"
1012
+            $hnd_file = \XoopsBaseConfig::get('root-path')."/modules/{$module_dir}/class/form/{$name}.php"
1013 1013
         )) {
1014 1014
             include_once $hnd_file;
1015
-            $class = ucfirst(strtolower($module_dir)) . ucfirst($name) . 'Form';
1015
+            $class = ucfirst(strtolower($module_dir)).ucfirst($name).'Form';
1016 1016
             if (class_exists($class)) {
1017 1017
                 $instance = new $class($obj);
1018 1018
                 if ($instance instanceof \Xoops\Form\Form) {
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
         if ((empty($domain) || 'global' === $domain)) {
1059 1059
             $path = '';
1060 1060
         } else {
1061
-            $path = (is_array($domain)) ? array_shift($domain) . '/' : "modules/{$domain}/";
1061
+            $path = (is_array($domain)) ? array_shift($domain).'/' : "modules/{$domain}/";
1062 1062
         }
1063 1063
         $path .= 'language';
1064 1064
 
@@ -1200,9 +1200,9 @@  discard block
 block discarded – undo
1200 1200
         $xoopsConfigMetaFooter = $this->getConfigs();
1201 1201
 
1202 1202
         if (!headers_sent()) {
1203
-            header('Content-Type:text/html; charset=' . XoopsLocale::getCharset());
1203
+            header('Content-Type:text/html; charset='.XoopsLocale::getCharset());
1204 1204
             header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
1205
-            header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
1205
+            header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
1206 1206
             header(
1207 1207
                 'Cache-Control: no-store, no-cache, max-age=1, s-maxage=1, must-revalidate, post-check=0, pre-check=0'
1208 1208
             );
@@ -1211,28 +1211,28 @@  discard block
 block discarded – undo
1211 1211
 
1212 1212
         echo "<!DOCTYPE html>\n";
1213 1213
         $xoops_url = \XoopsBaseConfig::get('url');
1214
-        echo '<html lang="' . XoopsLocale::getLangCode() . '">
1214
+        echo '<html lang="'.XoopsLocale::getLangCode().'">
1215 1215
               <head>
1216 1216
               <meta charset="utf-8">
1217 1217
               <meta http-equiv="X-UA-Compatible" content="IE=edge">
1218 1218
               <meta name="viewport" content="width=device-width, initial-scale=1">
1219
-              <meta name="robots" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_robots']) . '" />
1220
-              <meta name="keywords" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']) . '" />
1221
-              <meta name="description" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_description']) . '" />
1222
-              <meta name="rating" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_rating']) . '" />
1223
-              <meta name="author" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_author']) . '" />
1219
+              <meta name="robots" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_robots']).'" />
1220
+              <meta name="keywords" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']).'" />
1221
+              <meta name="description" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_description']).'" />
1222
+              <meta name="rating" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_rating']).'" />
1223
+              <meta name="author" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_author']).'" />
1224 1224
               <meta name="generator" content="XOOPS" />
1225
-              <title>' . htmlspecialchars($this->getConfig('sitename')) . '</title>'
1225
+              <title>' . htmlspecialchars($this->getConfig('sitename')).'</title>'
1226 1226
             . $this->theme->renderBaseAssets();
1227 1227
 
1228 1228
         $locale = $this->getConfig('locale');
1229
-        if (XoopsLoad::fileExists($this->path('locale/' . $locale . '/style.css'))) {
1230
-            echo '<link rel="stylesheet" type="text/css" media="all" href="' . $xoops_url
1231
-                . '/locale/' . $locale . '/style.css" />';
1229
+        if (XoopsLoad::fileExists($this->path('locale/'.$locale.'/style.css'))) {
1230
+            echo '<link rel="stylesheet" type="text/css" media="all" href="'.$xoops_url
1231
+                . '/locale/'.$locale.'/style.css" />';
1232 1232
         }
1233 1233
         $themecss = $this->getCss($this->getConfig('theme_set'));
1234 1234
         if ($themecss) {
1235
-            echo '<link rel="stylesheet" type="text/css" media="all" href="' . $themecss . '" />';
1235
+            echo '<link rel="stylesheet" type="text/css" media="all" href="'.$themecss.'" />';
1236 1236
         }
1237 1237
         if ($closehead) {
1238 1238
             echo '</head><body>';
@@ -1332,13 +1332,13 @@  discard block
 block discarded – undo
1332 1332
         foreach ($hiddens as $name => $value) {
1333 1333
             if (is_array($value)) {
1334 1334
                 foreach ($value as $caption => $newvalue) {
1335
-                    $str_hiddens .= '<input type="radio" name="' . $name . '" value="'
1336
-                        . htmlspecialchars($newvalue) . '" > ' . $caption . NWLINE;
1335
+                    $str_hiddens .= '<input type="radio" name="'.$name.'" value="'
1336
+                        . htmlspecialchars($newvalue).'" > '.$caption.NWLINE;
1337 1337
                 }
1338
-                $str_hiddens .= '<br />' . NWLINE;
1338
+                $str_hiddens .= '<br />'.NWLINE;
1339 1339
             } else {
1340
-                $str_hiddens .= '<input type="hidden" name="' . $name . '" value="'
1341
-                    . htmlspecialchars($value) . '" />' . NWLINE;
1340
+                $str_hiddens .= '<input type="hidden" name="'.$name.'" value="'
1341
+                    . htmlspecialchars($value).'" />'.NWLINE;
1342 1342
             }
1343 1343
         }
1344 1344
         if ($addtoken != false) {
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
         $url = trim($url);
1451 1451
         if ($url != '') {
1452 1452
             if (!preg_match('/^(https?|ftps?|ed2k)\:\/\//i', $url)) {
1453
-                $url = 'http://' . $url;
1453
+                $url = 'http://'.$url;
1454 1454
             }
1455 1455
         }
1456 1456
         return $url;
@@ -1519,7 +1519,7 @@  discard block
 block discarded – undo
1519 1519
         )));
1520 1520
         $this->setTpl($this->theme()->template);
1521 1521
         $this->tpl()->assign(array(
1522
-            'xoops_theme'      => $theme, 'xoops_imageurl' => \XoopsBaseConfig::get('themes-url') . '/' . $theme . '/',
1522
+            'xoops_theme'      => $theme, 'xoops_imageurl' => \XoopsBaseConfig::get('themes-url').'/'.$theme.'/',
1523 1523
             'xoops_themecss'   => $this->getCss($theme),
1524 1524
             'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES),
1525 1525
             'xoops_sitename'   => htmlspecialchars($this->getConfig('sitename'), ENT_QUOTES),
@@ -1531,8 +1531,8 @@  discard block
 block discarded – undo
1531 1531
 
1532 1532
         $this->tpl()->assign('time', (int)($time));
1533 1533
         if (!empty($_SERVER['REQUEST_URI']) && $addredirect && strstr($url, 'user.php')) {
1534
-            $joiner = (false===strpos($url, '?')) ? '?' : '&amp;';
1535
-            $url .= $joiner . 'xoops_redirect=' . urlencode($_SERVER['REQUEST_URI']);
1534
+            $joiner = (false === strpos($url, '?')) ? '?' : '&amp;';
1535
+            $url .= $joiner.'xoops_redirect='.urlencode($_SERVER['REQUEST_URI']);
1536 1536
         }
1537 1537
         $url = preg_replace("/&amp;/i", '&', htmlspecialchars($url, ENT_QUOTES));
1538 1538
         $this->tpl()->assign('url', $url);
@@ -1596,25 +1596,25 @@  discard block
 block discarded – undo
1596 1596
         }
1597 1597
         $xoops_theme_path = \XoopsBaseConfig::get('themes-path');
1598 1598
         $xoops_theme_url = \XoopsBaseConfig::get('themes-url');
1599
-        if (is_dir($xoops_theme_path . '/' . $theme)) {
1600
-            if (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/' . $str_css)) {
1601
-                return $xoops_theme_url . '/' . $theme . '/' . $str_css;
1602
-            } elseif (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/style.css')) {
1603
-                return $xoops_theme_url . '/' . $theme . '/style.css';
1599
+        if (is_dir($xoops_theme_path.'/'.$theme)) {
1600
+            if (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/'.$str_css)) {
1601
+                return $xoops_theme_url.'/'.$theme.'/'.$str_css;
1602
+            } elseif (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/style.css')) {
1603
+                return $xoops_theme_url.'/'.$theme.'/style.css';
1604 1604
             }
1605 1605
         }
1606
-        if (is_dir($xoops_theme_path . '/' . $theme . '/css')) {
1607
-            if (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/css/' . $str_css)) {
1608
-                return $xoops_theme_url . '/' . $theme . '/css/' . $str_css;
1609
-            } elseif (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/css/style.css')) {
1610
-                return $xoops_theme_url . '/' . $theme . '/css/style.css';
1606
+        if (is_dir($xoops_theme_path.'/'.$theme.'/css')) {
1607
+            if (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/css/'.$str_css)) {
1608
+                return $xoops_theme_url.'/'.$theme.'/css/'.$str_css;
1609
+            } elseif (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/css/style.css')) {
1610
+                return $xoops_theme_url.'/'.$theme.'/css/style.css';
1611 1611
             }
1612 1612
         }
1613
-        if (is_dir($xoops_theme_path . '/' . $theme . '/assets/css')) {
1614
-            if (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/assets/css/' . $str_css)) {
1615
-                return $xoops_theme_url . '/' . $theme . '/assets/css/' . $str_css;
1616
-            } elseif (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/assets/css/style.css')) {
1617
-                return $xoops_theme_url . '/' . $theme . '/assets/css/style.css';
1613
+        if (is_dir($xoops_theme_path.'/'.$theme.'/assets/css')) {
1614
+            if (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/assets/css/'.$str_css)) {
1615
+                return $xoops_theme_url.'/'.$theme.'/assets/css/'.$str_css;
1616
+            } elseif (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/assets/css/style.css')) {
1617
+                return $xoops_theme_url.'/'.$theme.'/assets/css/style.css';
1618 1618
             }
1619 1619
         }
1620 1620
         return '';
@@ -1728,7 +1728,7 @@  discard block
 block discarded – undo
1728 1728
             if (empty($dirname)) {
1729 1729
                 $dirname = $this->isModule() ? $this->module->getVar('dirname') : 'system';
1730 1730
             }
1731
-            $this->moduleConfigs[$dirname][$key] =& $value;
1731
+            $this->moduleConfigs[$dirname][$key] = & $value;
1732 1732
         }
1733 1733
     }
1734 1734
 
@@ -1812,18 +1812,18 @@  discard block
 block discarded – undo
1812 1812
             if (is_object($module)) {
1813 1813
                 $configs = $this->getHandlerConfig()->getConfigsByModule($module->getVar('mid'));
1814 1814
                 $this->cache()->write($key, $configs);
1815
-                $this->moduleConfigs[$dirname] =& $configs;
1815
+                $this->moduleConfigs[$dirname] = & $configs;
1816 1816
             }
1817 1817
         } else {
1818
-            $this->moduleConfigs[$dirname] =& $configs;
1818
+            $this->moduleConfigs[$dirname] = & $configs;
1819 1819
         }
1820 1820
 
1821 1821
         if ($this->isModule()) {
1822 1822
             //for legacy
1823
-            $this->moduleConfig =& $this->moduleConfigs[$this->module->getVar('dirname')];
1823
+            $this->moduleConfig = & $this->moduleConfigs[$this->module->getVar('dirname')];
1824 1824
         }
1825 1825
         if ($dirname === 'system') {
1826
-            $this->config =& $this->moduleConfigs['system'];
1826
+            $this->config = & $this->moduleConfigs['system'];
1827 1827
         }
1828 1828
         return $this->moduleConfigs[$dirname];
1829 1829
     }
@@ -1850,10 +1850,10 @@  discard block
 block discarded – undo
1850 1850
         }
1851 1851
         if ($appendWithKey) {
1852 1852
             foreach ($values as $key2 => $value) {
1853
-                $this->moduleConfigs[$dirname][$key][$key2] =& $value;
1853
+                $this->moduleConfigs[$dirname][$key][$key2] = & $value;
1854 1854
             }
1855 1855
         } else {
1856
-            $this->moduleConfigs[$dirname][$key][] =& $values;
1856
+            $this->moduleConfigs[$dirname][$key][] = & $values;
1857 1857
         }
1858 1858
     }
1859 1859
 
@@ -1883,7 +1883,7 @@  discard block
 block discarded – undo
1883 1883
      */
1884 1884
     public function getBaseDomain($url, $includeSubdomain = false)
1885 1885
     {
1886
-        $url=mb_strtolower($url, 'UTF-8');
1886
+        $url = mb_strtolower($url, 'UTF-8');
1887 1887
 
1888 1888
         $host = parse_url($url, PHP_URL_HOST);
1889 1889
         if (empty($host)) {
@@ -1894,13 +1894,13 @@  discard block
 block discarded – undo
1894 1894
         }
1895 1895
 
1896 1896
         // check for exceptions, localhost and ip address (v4 & v6)
1897
-        if ($host==='localhost') {
1897
+        if ($host === 'localhost') {
1898 1898
             return $host;
1899 1899
         }
1900 1900
         // Check for IPV6 URL (see http://www.ietf.org/rfc/rfc2732.txt)
1901 1901
         // strip brackets before validating
1902
-        if (substr($host, 0, 1)==='[' && substr($host, -1)===']') {
1903
-            $host = substr($host, 1, (strlen($host)-2));
1902
+        if (substr($host, 0, 1) === '[' && substr($host, -1) === ']') {
1903
+            $host = substr($host, 1, (strlen($host) - 2));
1904 1904
         }
1905 1905
         if (filter_var($host, FILTER_VALIDATE_IP)) {
1906 1906
             return $host;
@@ -1930,7 +1930,7 @@  discard block
 block discarded – undo
1930 1930
             $module = $tplfile->getVar('tpl_module', 'n');
1931 1931
             $type = $tplfile->getVar('tpl_type', 'n');
1932 1932
             $tpl = new XoopsTpl();
1933
-            return $tpl->touch($type . ':' . $module . '/' . $file);
1933
+            return $tpl->touch($type.':'.$module.'/'.$file);
1934 1934
         }
1935 1935
         return false;
1936 1936
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Locale.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -221,9 +221,9 @@  discard block
 block discarded – undo
221 221
             $fullPath = $xoops->path("{$path}/locale/{$locale}/locale.php");
222 222
             $fullPath2 = $xoops->path("{$path}/locale/{$locale}/{$locale}.php");
223 223
             if (\XoopsLoad::fileExists($fullPath)) {
224
-                \XoopsLoad::addMap(array($domain . 'locale' => $fullPath));
224
+                \XoopsLoad::addMap(array($domain.'locale' => $fullPath));
225 225
                 if (\XoopsLoad::fileExists($fullPath2)) {
226
-                    \XoopsLoad::addMap(array(strtolower($domain . "locale{$locale}") => $fullPath2));
226
+                    \XoopsLoad::addMap(array(strtolower($domain."locale{$locale}") => $fullPath2));
227 227
                 }
228 228
                 return true;
229 229
             }
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
             $fullPath = $xoops->path($theme->resourcePath("locale/{$locale}/locale.php"));
247 247
             $fullPath2 = $xoops->path($theme->resourcePath("locale/{$locale}/{$locale}.php"));
248 248
             if (\XoopsLoad::fileExists($fullPath)) {
249
-                \XoopsLoad::addMap(array(strtolower($theme->folderName . 'ThemeLocale') => $fullPath));
249
+                \XoopsLoad::addMap(array(strtolower($theme->folderName.'ThemeLocale') => $fullPath));
250 250
                 if (\XoopsLoad::fileExists($fullPath2)) {
251
-                    \XoopsLoad::addMap(array(strtolower($theme->folderName . "ThemeLocale{$locale}") => $fullPath2));
251
+                    \XoopsLoad::addMap(array(strtolower($theme->folderName."ThemeLocale{$locale}") => $fullPath2));
252 252
                 }
253 253
                 return true;
254 254
             }
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 
347 347
         $p = [];
348 348
         foreach ($params as $name => $value) {
349
-            $p['{' . $name . '}'] = $value;
349
+            $p['{'.$name.'}'] = $value;
350 350
         }
351 351
 
352 352
         return strtr($message, $p);
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
      */
373 373
     protected static function getClassFromDirname($dirname)
374 374
     {
375
-        return ucfirst($dirname) . 'Locale';
375
+        return ucfirst($dirname).'Locale';
376 376
     }
377 377
 
378 378
     /**
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
         if (!$dirname) {
386 386
             $dirname = \Xoops::getInstance()->theme()->folderName;
387 387
         }
388
-        return ucfirst($dirname) . 'ThemeLocale';
388
+        return ucfirst($dirname).'ThemeLocale';
389 389
     }
390 390
 
391 391
     /**
@@ -461,8 +461,8 @@  discard block
 block discarded – undo
461 461
             $keys = Data::explodeLocale($locale);
462 462
             $key = strtolower($keys['language']);
463 463
             $key .= (empty($keys['script']) || false === $withScript) ?
464
-                '' : $separator . ucfirst(strtolower($keys['script']));
465
-            $key .= empty($keys['territory']) ? '' : $separator . strtoupper($keys['territory']);
464
+                '' : $separator.ucfirst(strtolower($keys['script']));
465
+            $key .= empty($keys['territory']) ? '' : $separator.strtoupper($keys['territory']);
466 466
         } catch (InvalidLocale $e) {
467 467
             $key = '';
468 468
         }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Session/Manager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $name = $this->xoops->getConfig('session_name');
84 84
         $name = (empty($name)) ? 'xoops_session' : $name;
85 85
         $expire = (int)($this->xoops->getConfig('session_expire'));
86
-        $expire = ($expire>0) ? $expire : 300;
86
+        $expire = ($expire > 0) ? $expire : 300;
87 87
 
88 88
         $path = \XoopsBaseConfig::get('cookie-path');
89 89
         $domain = \XoopsBaseConfig::get('cookie-domain');
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         }
199 199
 
200 200
         // if we don't have the expires key, use a future value for test
201
-        if ($this->get('SESSION_MANAGER_EXPIRES', time()+10) < time()) {
201
+        if ($this->get('SESSION_MANAGER_EXPIRES', time() + 10) < time()) {
202 202
             return false;
203 203
         }
204 204
 
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Session/RememberMe.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         $this->now = time();
97 97
         $cookieData = $this->readUserCookie();
98 98
         if (false === $cookieData) {
99
-            return false;   // no or invalid cookie
99
+            return false; // no or invalid cookie
100 100
         }
101 101
         list($userId, $series, $token) = $cookieData;
102 102
         $this->readUserTokens($userId);
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
         if ($cookieData !== $notFound) {
381 381
             $temp = explode('-', $cookieData);
382 382
             if (count($temp) == 3) {
383
-                $temp[0] = (integer) $temp[0];
383
+                $temp[0] = (integer)$temp[0];
384 384
                 return $temp;
385 385
             }
386 386
             $this->clearUserCookie(); // clean up garbage cookie
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Session/Fingerprint.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function checkSessionPrint(AttributeInterface $session)
79 79
     {
80
-        $score = 0;   // combined levenshtein distance of changes
80
+        $score = 0; // combined levenshtein distance of changes
81 81
         $changes = 0; // number of changed fields
82 82
         $currentFingerprint = $this->takePrint();
83 83
         $savedFingerprint = unserialize($session->get('SESSION_FINGERPRINT'));
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         foreach ($currentFingerprint as $key => $current) {
90 90
             $distance = levenshtein($current, $savedFingerprint[$key]);
91 91
             $score += $distance;
92
-            $changes += ($distance>0) ? 1 : 0;
92
+            $changes += ($distance > 0) ? 1 : 0;
93 93
         }
94 94
 
95 95
         $return = true;
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Session/Handler.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      **/
112 112
     public function write($session_id, $session_data)
113 113
     {
114
-        $expires =  (isset($_SESSION['SESSION_MANAGER_EXPIRES']))
114
+        $expires = (isset($_SESSION['SESSION_MANAGER_EXPIRES']))
115 115
             ? (int)($_SESSION['SESSION_MANAGER_EXPIRES'])
116 116
             : time() + (session_cache_expire() * 60);
117 117
         //$oldIsolation = $this->db->getTransactionIsolation();
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             ->setParameter(':sessdata', $session_data, \PDO::PARAM_STR);
130 130
         $this->db->setForce(true);
131 131
         $result = $qb->execute();
132
-        if ($result<=0) {
132
+        if ($result <= 0) {
133 133
             $qb = $this->db->createXoopsQueryBuilder();
134 134
             $qb ->insertPrefix($this->sessionTable)
135 135
                 ->values(array(
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         //$this->db->commit();
147 147
         //$this->db->setTransactionIsolation($oldIsolation);
148 148
 
149
-        return (boolean) ($result>0);
149
+        return (boolean)($result > 0);
150 150
     }
151 151
 
152 152
     /**
@@ -186,6 +186,6 @@  discard block
 block discarded – undo
186 186
             ->setParameter(':expires', $mintime, \PDO::PARAM_INT);
187 187
         $this->db->setForce(true);
188 188
         $result = $qb->execute();
189
-        return (boolean) ($result>0);
189
+        return (boolean)($result > 0);
190 190
     }
191 191
 }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Cache/CacheManager.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@
 block discarded – undo
57 57
     {
58 58
         $this->xoops = \Xoops::getInstance();
59 59
         $defaults = $this->getDefaults();
60
-		$xoops_var_path = \XoopsBaseConfig::get('var-path');
61
-		$cache_file = $xoops_var_path . '/configs/cache.php';
60
+        $xoops_var_path = \XoopsBaseConfig::get('var-path');
61
+        $cache_file = $xoops_var_path . '/configs/cache.php';
62 62
         $poolDefs = Yaml::readWrapped($cache_file);
63 63
         if (empty($poolDefs)) {
64 64
             Yaml::saveWrapped($defaults, $cache_file);
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $this->xoops = \Xoops::getInstance();
59 59
         $defaults = $this->getDefaults();
60 60
 		$xoops_var_path = \XoopsBaseConfig::get('var-path');
61
-		$cache_file = $xoops_var_path . '/configs/cache.php';
61
+		$cache_file = $xoops_var_path.'/configs/cache.php';
62 62
         $poolDefs = Yaml::readWrapped($cache_file);
63 63
         if (empty($poolDefs)) {
64 64
             Yaml::saveWrapped($defaults, $cache_file);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $defaults = [
79 79
             'default' => [
80 80
                 'driver' => 'Sqlite',
81
-                'options' => ['path' => \XoopsBaseConfig::get('var-path') . '/stash/'],
81
+                'options' => ['path' => \XoopsBaseConfig::get('var-path').'/stash/'],
82 82
                 ],
83 83
             'temp' => [
84 84
                 'driver' => 'Ephemeral',
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public static function createDefaultConfig()
113 113
     {
114
-        $configFile = \XoopsBaseConfig::get('var-path') . '/configs/cache.php';
114
+        $configFile = \XoopsBaseConfig::get('var-path').'/configs/cache.php';
115 115
         if (file_exists($configFile)) {
116 116
             return;
117 117
         }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $defaults['default']['driver'] = 'FileSystem';
121 121
             $defaults['default']['options'] = [
122 122
                 'dirSplit' => 1,
123
-                'path' => \XoopsBaseConfig::get('var-path') . '/stash/'
123
+                'path' => \XoopsBaseConfig::get('var-path').'/stash/'
124 124
             ];
125 125
             if (false !== stripos(PHP_OS, 'WIN')) {
126 126
                 trigger_error("SQLite is strongly recommended on windows due to 260 character file path restrictions.");
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
     {
141 141
         $pool = false;
142 142
         if (array_key_exists($name, $this->pools)) {
143
-            $pool =  $this->pools[$name];
143
+            $pool = $this->pools[$name];
144 144
         } elseif (array_key_exists($name, $this->poolDefs)) {
145
-            $pool =  $this->startPoolAccess($name);
145
+            $pool = $this->startPoolAccess($name);
146 146
         }
147 147
         if ($pool === false) {
148 148
             $pool = $this->getDefaultPool($name);
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         }
179 179
 
180 180
         $driver = $this->getDriver($driverName, $options);
181
-        if ($driver!==false) {
181
+        if ($driver !== false) {
182 182
             $pool = new Pool($driver);
183 183
             if (is_object($pool)) {
184 184
                 $pool->setLogger($this->xoops->logger());
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         $driver = false;
207 207
         $driverClass = DriverList::getDriverClass($driverName);
208 208
 
209
-        if ($driverClass!==false && $driverClass::isAvailable()) {
209
+        if ($driverClass !== false && $driverClass::isAvailable()) {
210 210
             $options = is_array($options) ? $options : array();
211 211
             $driver = new $driverClass($options);
212 212
         }
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
             return $this->pools[$name];
230 230
         }
231 231
         $pool = $this->startPoolAccess($name);
232
-        if ($pool===false) {
232
+        if ($pool === false) {
233 233
             $this->xoops->logger()->error('Could not create default cache pool');
234 234
             $pool = new Access(new \Stash\Pool());
235 235
         }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Cache/Legacy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@
 block discarded – undo
34 34
         $stack = debug_backtrace();
35 35
         $frameSelf = $stack[1];
36 36
         $frame = isset($stack[2]) ? $stack[2] : false;
37
-        $append = ' ' . get_called_class() . '::' . $frameSelf['function'] . '() called from ';
37
+        $append = ' '.get_called_class().'::'.$frameSelf['function'].'() called from ';
38 38
         if ($frame !== false) {
39
-            $append .= $frame['function'] . '() in ';
39
+            $append .= $frame['function'].'() in ';
40 40
         }
41
-        $append .= $frameSelf['file'] . ' line '. $frameSelf['line'];
42
-        \Xoops::getInstance()->deprecated($message . $append);
41
+        $append .= $frameSelf['file'].' line '.$frameSelf['line'];
42
+        \Xoops::getInstance()->deprecated($message.$append);
43 43
     }
44 44
 
45 45
     /**
Please login to merge, or discard this patch.