Completed
Push — master ( 0c98dc...038288 )
by Richard
15s queued 11s
created
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.
xoops_lib/Xoops/Core/XoopsTpl.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $countLeft = 0;
83 83
         $countRight = -1;
84 84
         $temp = str_replace('<{', '{', $tpl_source, $countLeft);
85
-        if ($countLeft>0) {
85
+        if ($countLeft > 0) {
86 86
             $temp = str_replace('}>', '}', $temp, $countRight);
87 87
         }
88 88
         return ($countLeft === $countRight) ? $temp : $tpl_source;
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
         $template_set = empty($template_set) ? $xoops->getConfig('template_set') : $template_set;
122 122
         $theme_set = empty($theme_set) ? $xoops->getConfig('theme_set') : $theme_set;
123 123
         $module_dirname = empty($module_dirname) ? $xoops->moduleDirname : $module_dirname;
124
-        $this->compile_id = substr(md5(\XoopsBaseConfig::get('url')), 0, 8) . '-' . $module_dirname
125
-            . '-' . $theme_set . '-' . $template_set;
124
+        $this->compile_id = substr(md5(\XoopsBaseConfig::get('url')), 0, 8).'-'.$module_dirname
125
+            . '-'.$theme_set.'-'.$template_set;
126 126
         //$this->_compile_id = $this->compile_id;
127 127
     }
128 128
 
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
         $compile_id = $this->compile_id;
149 149
         $this->compile_id = $hold_compile_id;
150 150
         $compile_id = preg_replace('![^\w\|]+!', '_', $compile_id);
151
-        $glob = $compile_id . '*.php';
152
-        $count=0;
153
-        $files = glob($this->getCompileDir() . '/' . $glob);
151
+        $glob = $compile_id.'*.php';
152
+        $count = 0;
153
+        $files = glob($this->getCompileDir().'/'.$glob);
154 154
         foreach ($files as $filename) {
155 155
             $count += unlink($filename) ? 1 : 0;
156 156
         }
157
-        $files = glob($this->getCacheDir() . '/*' . $glob);
157
+        $files = glob($this->getCacheDir().'/*'.$glob);
158 158
         foreach ($files as $filename) {
159 159
             $count += unlink($filename) ? 1 : 0;
160 160
         }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Text/ShortCodes.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         // allow [[foo]] syntax for escaping a tag
175 175
         if ($tag[1] === '[' && $tag[6] === ']') {
176 176
             //return substr($tag[0], 1, -1);
177
-            return '&#91;' . substr($tag[0], 2, -2) . '&#93';
177
+            return '&#91;'.substr($tag[0], 2, -2).'&#93';
178 178
         }
179 179
 
180 180
         $tagName = $tag[2];
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 
183 183
         if (isset($tag[5])) {
184 184
             // enclosing tag - extra parameter
185
-            return $tag[1] . call_user_func($this->shortcodes[$tagName], $attr, $tag[5], $tagName) . $tag[6];
185
+            return $tag[1].call_user_func($this->shortcodes[$tagName], $attr, $tag[5], $tagName).$tag[6];
186 186
         } else {
187 187
             // self-closing tag
188
-            return $tag[1] . call_user_func($this->shortcodes[$tagName], $attr, null, $tagName) . $tag[6];
188
+            return $tag[1].call_user_func($this->shortcodes[$tagName], $attr, null, $tagName).$tag[6];
189 189
         }
190 190
     }
191 191
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
             return substr($tag[0], 1, -1);
272 272
         }
273 273
 
274
-        return $tag[1] . $tag[6];
274
+        return $tag[1].$tag[6];
275 275
     }
276 276
 
277 277
     /**
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Text/Sanitizer/Extensions/Xss.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
         }
82 82
         $len = (((mb_strlen($text) - $config['truncate_length']) - 5) / 2);
83 83
         if ($len < 5) {
84
-            $ret = mb_substr($text, 0, $len) . ' ... ' . mb_substr($text, -$len);
84
+            $ret = mb_substr($text, 0, $len).' ... '.mb_substr($text, -$len);
85 85
         } else {
86 86
             $ret = mb_substr($text, 0, $config['truncate_length']);
87 87
         }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Text/Sanitizer/Extensions/Image.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
      */
35 35
     protected static $defaultConfiguration = [
36 36
         'enabled' => true,
37
-        'clickable' => true,  // Click to open an image in a new window in full size
38
-        'resize' => true,     // Resize the image down to max_width set below
39
-        'max_width' => 300,   // Maximum width of an image displayed on page
37
+        'clickable' => true, // Click to open an image in a new window in full size
38
+        'resize' => true, // Resize the image down to max_width set below
39
+        'max_width' => 300, // Maximum width of an image displayed on page
40 40
         'allowimage' => true, // true to allow images, false to force links only
41 41
     ];
42 42
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         $this->shortcodes->addShortcode(
53 53
             'img',
54
-            function ($attributes, $content, $tagName) use ($config) {
54
+            function($attributes, $content, $tagName) use ($config) {
55 55
                 $xoops = \Xoops::getInstance();
56 56
                 $defaults = [
57 57
                     'id' => 0,
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                 ];
62 62
                 $cleanAttributes = $this->shortcodes->shortcodeAttributes($defaults, $attributes);
63 63
                 if (0 !== $cleanAttributes['id']) {
64
-                    $cleanAttributes['url'] = $xoops->url('/image.php?id=' . $cleanAttributes['id']);
64
+                    $cleanAttributes['url'] = $xoops->url('/image.php?id='.$cleanAttributes['id']);
65 65
                 }
66 66
                 $url = $cleanAttributes['url'];
67 67
 
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
                     true
73 73
                 );
74 74
                 $class = '';
75
-                if ($cleanAttributes['align']!= '') {
76
-                    $class = ' class="' . $cleanAttributes['align'] . '"';
75
+                if ($cleanAttributes['align'] != '') {
76
+                    $class = ' class="'.$cleanAttributes['align'].'"';
77 77
                 }
78 78
                 $width = $cleanAttributes['width'];
79 79
                 if (preg_match('/[0-9]{1}$/', $width)) {
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Text/Sanitizer/Extensions/Censor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     protected static $defaultConfiguration = [
34 34
         'enabled' => true,
35 35
         'censor_terminate' => false, //set to true if you want to trigger an error page
36
-        'censor_admin' => true,      //set to false if you don't want to censor admin entries
36
+        'censor_admin' => true, //set to false if you don't want to censor admin entries
37 37
         'censor_words' => ['shit', 'piss', 'fuck', 'cunt', 'cocksucker', 'motherfucker', 'tits'],
38 38
         'censor_replace' => '%#$@!',
39 39
     ];
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
     {
50 50
         $xoops = \Xoops::getInstance();
51 51
 
52
-        $enabled = (bool) $xoops->getConfig('censor_enable');
52
+        $enabled = (bool)$xoops->getConfig('censor_enable');
53 53
 
54
-        $censorWords = (array) $xoops->getConfig('censor_words');
54
+        $censorWords = (array)$xoops->getConfig('censor_words');
55 55
         $censorWords = empty($censorWords) ? $this->config['censor_words'] : $censorWords;
56 56
 
57 57
         $censorReplace = $xoops->getConfig('censor_replace');
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                 if (false === stripos($text, $bad)) {
74 74
                     continue;
75 75
                 }
76
-                if ((bool) $this->config['censor_terminate']) {
76
+                if ((bool)$this->config['censor_terminate']) {
77 77
                     trigger_error("Censor words found", E_USER_ERROR);
78 78
                     return '';
79 79
                 }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Text/Sanitizer/Extensions/SyntaxHighlight.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         $text = trim($text);
76 76
         $addedOpenTag = false;
77 77
         if (!strpos($text, "<?php") && (substr($text, 0, 5) !== "<?php")) {
78
-            $text = "<?php " . $text;
78
+            $text = "<?php ".$text;
79 79
             $addedOpenTag = true;
80 80
         }
81 81
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         $length_open = ($addedOpenTag) ? $pos_open + 14 : 0;
102 102
         $str_internal = substr($buffer, $length_open);
103 103
 
104
-        $buffer = $str_open . $str_internal;
104
+        $buffer = $str_open.$str_internal;
105 105
         return $buffer;
106 106
     }
107 107
 
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Text/Sanitizer/Extensions/Quote.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 
52 52
         //look for both open and closing tags in the correct order
53 53
         $pattern = "/\[quote](.*)\[\/quote\]/sU";
54
-        $replacement = \XoopsLocale::C_QUOTE . '<div class="xoopsQuote"><blockquote>\\1</blockquote></div>';
54
+        $replacement = \XoopsLocale::C_QUOTE.'<div class="xoopsQuote"><blockquote>\\1</blockquote></div>';
55 55
 
56 56
         $text = preg_replace($pattern, $replacement, $text, -1, $count);
57 57
         //no more matches, return now
Please login to merge, or discard this patch.