Passed
Push — master ( ded335...50efcf )
by Goffy
04:50 queued 01:37
created
class/CheckonlineHandler.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
             //execute post
72 72
             $result = \curl_exec($ch);
73 73
             // print_r(\curl_getinfo($ch));
74
-            if (false == $result)  {
74
+            if (false == $result) {
75 75
                 //echo '<br>unexpected curl_error:' . \curl_error($ch) . '<br>';
76
-                $GLOBALS['xoopsTpl']->assign('error',\curl_error($ch));
76
+                $GLOBALS['xoopsTpl']->assign('error', \curl_error($ch));
77 77
             }
78 78
 
79 79
             \curl_close($ch);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 ]
87 87
             ];
88 88
 
89
-            $context  = \stream_context_create($opts);
89
+            $context = \stream_context_create($opts);
90 90
             $result = \file_get_contents($oc_server, false, $context);
91 91
         }
92 92
         return $result;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      * @param string $xml_string
99 99
      * @return array|\SimpleXMLElement|string
100 100
      */
101
-    public function readXML(string $xml_string){
101
+    public function readXML(string $xml_string) {
102 102
         // creating temporary string for avoiding entitiy errors
103 103
         $xml_string = \str_replace('&', '[[avoid_entity_error]]', $xml_string);
104 104
         $xml_arr = \simplexml_load_string($xml_string);
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $errors = \libxml_get_errors();
109 109
             foreach ($errors as $error) {
110 110
                 //echo $this->display_xml_error($error, $xml);
111
-                $GLOBALS['xoopsTpl']->assign('error',$this->display_xml_error($error, $xml));
111
+                $GLOBALS['xoopsTpl']->assign('error', $this->display_xml_error($error, $xml));
112 112
             }
113 113
             \libxml_clear_errors();
114 114
         }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      * @param string $xml
123 123
      * @return string
124 124
      */
125
-    public function xml2str(string $xml){
125
+    public function xml2str(string $xml) {
126 126
         // replace temporary string for avoiding entitiy errors
127 127
         $str = \str_replace('[[avoid_entity_error]]', '&', (string)$xml);
128 128
         // rebuild html tags
Please login to merge, or discard this patch.
class/Common/MigrateHelper.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 $skip = false;
95 95
                 $options = '';
96 96
                 // start table definition
97
-                $tableName = $this->getTableName ($line);
97
+                $tableName = $this->getTableName($line);
98 98
                 $tables[$tableName] = [];
99 99
                 $tables[$tableName]['options'] = '';
100 100
                 $tables[$tableName]['columns'] = [];
@@ -183,10 +183,10 @@  discard block
 block discarded – undo
183 183
      * @param  string $line
184 184
      * @return string|bool
185 185
      */
186
-    private function getTableName (string $line)
186
+    private function getTableName(string $line)
187 187
     {
188 188
 
189
-        $arrLine = \explode( '`', $line);
189
+        $arrLine = \explode('`', $line);
190 190
         if (\count($arrLine) > 0) {
191 191
             return $arrLine[1];
192 192
         }
@@ -201,12 +201,12 @@  discard block
 block discarded – undo
201 201
      * @param string $line
202 202
      * @return array|bool
203 203
      */
204
-    private function getColumns (string $line)
204
+    private function getColumns(string $line)
205 205
     {
206 206
 
207 207
         $columns = [];
208 208
 
209
-        $arrCol = \explode( ' ', \trim($line));
209
+        $arrCol = \explode(' ', \trim($line));
210 210
         if (\count($arrCol) > 0) {
211 211
             $name = \str_replace(['`'], '', $arrCol[0]);
212 212
         } else {
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
         $columns['name'] = $name;
218 218
         // update quotes
219 219
         if (\strpos($attributes, "''") > 0) {
220
-            $attributes = \trim(\str_replace("''", "''''''''" , $attributes));
220
+            $attributes = \trim(\str_replace("''", "''''''''", $attributes));
221 221
         } elseif (\strpos($attributes, "'") > 0) {
222
-            $attributes = \trim(\str_replace("'", "''" , $attributes));
222
+            $attributes = \trim(\str_replace("'", "''", $attributes));
223 223
         }
224 224
         $columns['attributes'] = "' " . $attributes . " '";
225 225
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      * @param string $options
235 235
      * @return void
236 236
      */
237
-    private function getOptions (string $line, string &$options): void
237
+    private function getOptions(string $line, string &$options): void
238 238
     {
239 239
 
240 240
         $lineText = \trim(\str_replace([')', ';'], '', $line));
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      * @param string $line
254 254
      * @return array
255 255
      */
256
-    private function getKey (string $line)
256
+    private function getKey(string $line)
257 257
     {
258 258
 
259 259
         $key = [];
@@ -276,11 +276,11 @@  discard block
 block discarded – undo
276 276
                 if ('' == $name) {
277 277
                     $name = $columns;
278 278
                 }
279
-                if (\strpos($name,' ') > 0) {
279
+                if (\strpos($name, ' ') > 0) {
280 280
                     $name = "'" . $name . "'";
281 281
                 }
282 282
                 $key[$name] = [];
283
-                if (\strpos($columns,' ') > 0) {
283
+                if (\strpos($columns, ' ') > 0) {
284 284
                     $columns = "'" . $columns . "'";
285 285
                 }
286 286
                 $key[$name]['columns'] = $columns;
Please login to merge, or discard this patch.
header.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 require_once \dirname(__DIR__, 2) . '/mainfile.php';
27 27
 $dirname = $GLOBALS['xoopsModule']->getVar('dirname');
28
-$pathname = \XOOPS_ROOT_PATH. '/modules/'.$dirname;
28
+$pathname = \XOOPS_ROOT_PATH . '/modules/' . $dirname;
29 29
 include_once $pathname . '/include/common.php';
30 30
 // Get instance of module
31 31
 $helper = Helper::getInstance();
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 //
39 39
 $myts = MyTextSanitizer::getInstance();
40 40
 $style = \WGSITENOTICE_URL . '/assets/css/style.css';
41
-if(\file_exists($style)) { return true; }
41
+if (\file_exists($style)) { return true; }
42 42
 //
43 43
 $sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16');
44 44
 $sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32');
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 $modPathIcon16 = $xoopsModule->getInfo('modicons16');
48 48
 $modPathIcon32 = $xoopsModule->getInfo('modicons32');
49 49
 // Breadcrumbs
50
-$xoBreadcrumbs   = [];
50
+$xoBreadcrumbs = [];
51 51
 //
52 52
 \xoops_loadLanguage('modinfo', $dirname);
53 53
 \xoops_loadLanguage('main', $dirname);
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 
29 29
 $GLOBALS['xoopsOption']['template_main'] = 'user/' . $helper->getConfig('wgsitenotice_template') . '/wgsitenotice_index_'
30 30
                                            . $helper->getConfig('wgsitenotice_template') . '.tpl';
31
-include_once \XOOPS_ROOT_PATH.'/header.php';
31
+include_once \XOOPS_ROOT_PATH . '/header.php';
32 32
 
33 33
 // Define Stylesheet
34
-$xoTheme->addStylesheet( $style );
34
+$xoTheme->addStylesheet($style);
35 35
 
36
-$breadcrumb ='<a href="' . \XOOPS_URL . '">' . \_YOURHOME . '</a>  &raquo; ' . $xoopsModule->name();
36
+$breadcrumb = '<a href="' . \XOOPS_URL . '">' . \_YOURHOME . '</a>  &raquo; ' . $xoopsModule->name();
37 37
 
38 38
 $version_id = Request::getInt('version_id');
39 39
 
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
 
94 94
 
95 95
 // keywords
96
-wgsitenotice_meta_keywords($helper->getConfig('keywords').', '. \implode(', ', $keywords));
96
+wgsitenotice_meta_keywords($helper->getConfig('keywords') . ', ' . \implode(', ', $keywords));
97 97
 unset($keywords);
98 98
 // description
99 99
 wgsitenotice_meta_description(\_MA_WGSITENOTICE_DESC);
100 100
 //
101
-$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', \WGSITENOTICE_URL.'/contents.php');
101
+$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', \WGSITENOTICE_URL . '/contents.php');
102 102
 //
103 103
 include_once __DIR__ . '/footer.php';
Please login to merge, or discard this patch.
admin/contents.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 $GLOBALS['xoopsTpl']->append('contents_list', $cont);
89 89
                 unset($cont);
90 90
             }
91
-            if ( $contents_rows > $limit ) {
91
+            if ($contents_rows > $limit) {
92 92
                 include_once \XOOPS_ROOT_PATH . '/class/pagenav.php';
93 93
                 $pagenav = new \XoopsPageNav($contents_rows, $limit, $start, 'start', 'op=list&limit=' . $limit);
94 94
                 $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav());
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $GLOBALS['xoopsTpl']->assign('form', $form->render());
109 109
     break;
110 110
     case 'save':
111
-        if ( !$GLOBALS['xoopsSecurity']->check() ) {
111
+        if (!$GLOBALS['xoopsSecurity']->check()) {
112 112
            \redirect_header('contents.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
113 113
         }
114 114
         if (isset($cont_id)) {
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $contentsObj->setVar('cont_header', Request::getString('cont_header'));
124 124
         // Set Var cont_text
125 125
         //fix for avoid hiding empty paragraphs in some browsers (instead of: $contentsObj->setVar('cont_weight', $_POST['cont_weight']);
126
-        $cont_text =  Request::getString('cont_text', '', 'default', 2);
126
+        $cont_text = Request::getString('cont_text', '', 'default', 2);
127 127
         $contentsObj->setVar('cont_text', \preg_replace('/<p><\/p>/', '<p>&nbsp;</p>', $cont_text));
128 128
         // Set Var cont_weight
129 129
         $contentsObj->setVar('cont_weight', Request::getInt('cont_weight'));
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     case 'delete':
153 153
         $contentsObj = $contentsHandler->get($cont_id);
154 154
         if (1 === Request::getInt('ok')) {
155
-            if ( !$GLOBALS['xoopsSecurity']->check() ) {
155
+            if (!$GLOBALS['xoopsSecurity']->check()) {
156 156
                 \redirect_header('contents.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors()));
157 157
             }
158 158
             if ($contentsHandler->delete($contentsObj)) {
@@ -167,9 +167,9 @@  discard block
 block discarded – undo
167 167
 
168 168
     case 'order':
169 169
         $corder = Request::getArray('corder');
170
-        for ($i = 0, $iMax = \count($corder); $i < $iMax; $i++){
170
+        for ($i = 0, $iMax = \count($corder); $i < $iMax; $i++) {
171 171
             $contentsObj = $contentsHandler->get($corder[$i]);
172
-            $contentsObj->setVar('cont_weight',$i+1);
172
+            $contentsObj->setVar('cont_weight', $i + 1);
173 173
             $contentsHandler->insert($contentsObj);
174 174
         }
175 175
         break;
Please login to merge, or discard this patch.
xoops_version.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
     'help'                => 'page=help',
40 40
     'license_url'         => 'www.gnu.org/licenses/gpl-2.0.html/',
41 41
     'release_info'        => '',
42
-    'release_file'        => \XOOPS_URL."/modules/{$dirname}/docs/release_info file",
42
+    'release_file'        => \XOOPS_URL . "/modules/{$dirname}/docs/release_info file",
43 43
     'release_date'        => '2023/04/08', // format: yyyy/mm/dd
44 44
     'manual'              => 'link to manual file',
45
-    'manual_file'         => \XOOPS_URL."/modules/{$dirname}/docs/install.txt",
45
+    'manual_file'         => \XOOPS_URL . "/modules/{$dirname}/docs/install.txt",
46 46
     'min_php'             => '7.4',
47 47
     'min_xoops'           => '2.5.11 RC1',
48 48
     'min_admin'           => '1.1',
@@ -184,10 +184,10 @@  discard block
 block discarded – undo
184 184
     'default'     => 1,
185 185
 ];
186 186
 
187
-$currdirname = isset($GLOBALS['xoopsModule'])&& \is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system';
187
+$currdirname = isset($GLOBALS['xoopsModule']) && \is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system';
188 188
 if ($dirname == $currdirname) {
189
-    $subcount = 1 ;
190
-    $pathname = \XOOPS_ROOT_PATH. '/modules/'.$dirname;
189
+    $subcount = 1;
190
+    $pathname = \XOOPS_ROOT_PATH . '/modules/' . $dirname;
191 191
     include_once $pathname . '/include/common.php';
192 192
     // Get instance of module
193 193
     $helper = Helper::getInstance();
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         foreach (\array_keys($versions_arr) as $i)
205 205
         {
206 206
             $modversion['sub'][$subcount]['name'] = $versions_arr[$i]->getVar('version_name');
207
-            $modversion['sub'][$subcount++]['url'] = 'index.php?version_id=' . $versions_arr[$i]->getVar('version_id') ;
207
+            $modversion['sub'][$subcount++]['url'] = 'index.php?version_id=' . $versions_arr[$i]->getVar('version_id');
208 208
         }
209 209
     }
210 210
 }
Please login to merge, or discard this patch.