Passed
Push — GENERAL_BUG_REVIEW_240911 ( 3362b2...8cbbee )
by Rafael
49:13
created
public/htdocs/core/lib/modulebuilder.lib.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1387,7 +1387,7 @@
 block discarded – undo
1387 1387
 
1388 1388
     // build format asciidoc for urls in table
1389 1389
     if (!$error) {
1390
-		$asciiDocTable = "[options=\"header\"]\n|===\n|Object | URLs\n";  // phpcs:ignore
1390
+        $asciiDocTable = "[options=\"header\"]\n|===\n|Object | URLs\n";  // phpcs:ignore
1391 1391
         foreach ($groupedUrls as $objectName => $urls) {
1392 1392
             $urlsList = implode(" +\n*", $urls);
1393 1393
             $asciiDocTable .= "|$objectName | \n*$urlsList +\n";
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -277,22 +277,22 @@  discard block
 block discarded – undo
277 277
     // Edit .sql file
278 278
     if ($moduletype == 'internal') {
279 279
         $pathoffiletoeditsrc = '/../install/mysql/tables/llx_' . strtolower($module) . '_' . strtolower($objectname) . '.sql';
280
-        if (! dol_is_file($readdir . $pathoffiletoeditsrc)) {
280
+        if (!dol_is_file($readdir . $pathoffiletoeditsrc)) {
281 281
             $pathoffiletoeditsrc = '/../install/mysql/tables/llx_' . strtolower($module) . '_' . strtolower($objectname) . '-' . strtolower($module) . '.sql';
282
-            if (! dol_is_file($readdir . $pathoffiletoeditsrc)) {
282
+            if (!dol_is_file($readdir . $pathoffiletoeditsrc)) {
283 283
                 $pathoffiletoeditsrc = '/../install/mysql/tables/llx_' . strtolower($module) . '-' . strtolower($module) . '.sql';
284
-                if (! dol_is_file($readdir . $pathoffiletoeditsrc)) {
284
+                if (!dol_is_file($readdir . $pathoffiletoeditsrc)) {
285 285
                     $pathoffiletoeditsrc = '/../install/mysql/tables/llx_' . strtolower($module) . '.sql';
286 286
                 }
287 287
             }
288 288
         }
289 289
     } else {
290 290
         $pathoffiletoeditsrc = '/sql/llx_' . strtolower($module) . '_' . strtolower($objectname) . '.sql';
291
-        if (! dol_is_file($readdir . $pathoffiletoeditsrc)) {
291
+        if (!dol_is_file($readdir . $pathoffiletoeditsrc)) {
292 292
             $pathoffiletoeditsrc = '/sql/llx_' . strtolower($module) . '_' . strtolower($objectname) . '-' . strtolower($module) . '.sql';
293
-            if (! dol_is_file($readdir . $pathoffiletoeditsrc)) {
293
+            if (!dol_is_file($readdir . $pathoffiletoeditsrc)) {
294 294
                 $pathoffiletoeditsrc = '/sql/llx_' . strtolower($module) . '-' . strtolower($module) . '.sql';
295
-                if (! dol_is_file($readdir . $pathoffiletoeditsrc)) {
295
+                if (!dol_is_file($readdir . $pathoffiletoeditsrc)) {
296 296
                     $pathoffiletoeditsrc = '/sql/llx_' . strtolower($module) . '.sql';
297 297
                 }
298 298
             }
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
 {
736 736
 
737 737
     // stock all properties in array
738
-    $attributesUnique = array('type','label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default' , 'foreignkey', 'arrayofkeyval', 'alwayseditable','validate', 'searchall','comment', 'isameasure', 'css', 'cssview','csslist', 'help', 'showoncombobox','picto' );
738
+    $attributesUnique = array('type', 'label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default', 'foreignkey', 'arrayofkeyval', 'alwayseditable', 'validate', 'searchall', 'comment', 'isameasure', 'css', 'cssview', 'csslist', 'help', 'showoncombobox', 'picto');
739 739
 
740 740
     $start = "public \$fields=array(";
741 741
     $end = ");";
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
     $string = "[options='header',grid=rows,width=60%,caption=Organisation]\n";
916 916
     $string .= "|===\n";
917 917
     // header for table
918
-    $header = array($langs->trans('Objects'),$langs->trans('Permission'));
918
+    $header = array($langs->trans('Objects'), $langs->trans('Permission'));
919 919
     foreach ($header as $h) {
920 920
         $string .= "|" . $h;
921 921
     }
@@ -1248,7 +1248,7 @@  discard block
 block discarded – undo
1248 1248
                  * @param mixed $val
1249 1249
                  * @return string|int
1250 1250
                  */
1251
-                function ($val) use ($module) {
1251
+                function($val) use ($module) {
1252 1252
                     return is_bool($val) ? "isModEnabled('$module')" : $val;
1253 1253
                 },
1254 1254
                 $value
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
                          * @param string $val
1270 1270
                          * @return string
1271 1271
                          */
1272
-                        static function ($val) {
1272
+                        static function($val) {
1273 1273
                             return "'$val'";
1274 1274
                         },
1275 1275
                         $value
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
     $dictionnaires['tabfieldvalue'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : '');
1364 1364
     $dictionnaires['tabfieldinsert'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : '');
1365 1365
     $dictionnaires['tabrowid'][] = $primaryKey;
1366
-    $dictionnaires['tabcond'][] = isModEnabled('$modulename');  // @phan-suppress-current-line UnknownModuleName
1366
+    $dictionnaires['tabcond'][] = isModEnabled('$modulename'); // @phan-suppress-current-line UnknownModuleName
1367 1367
     $dictionnaires['tabhelp'][] = (array_key_exists('code', $columns) ? array('code' => $langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip') : '');
1368 1368
 
1369 1369
     // Build the dictionary string
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
 
1418 1418
     // build format asciidoc for urls in table
1419 1419
     if (!$error) {
1420
-		$asciiDocTable = "[options=\"header\"]\n|===\n|Object | URLs\n";  // phpcs:ignore
1420
+		$asciiDocTable = "[options=\"header\"]\n|===\n|Object | URLs\n"; // phpcs:ignore
1421 1421
         foreach ($groupedUrls as $objectName => $urls) {
1422 1422
             $urlsList = implode(" +\n*", $urls);
1423 1423
             $asciiDocTable .= "|$objectName | \n*$urlsList +\n";
Please login to merge, or discard this patch.
public/htdocs/core/lib/fichinter.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@
 block discarded – undo
144 144
             } else {
145 145
                 dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
146 146
             }
147
-            dol_setcache($cachekey, $nbEvent, 120);     // If setting cache fails, this is not a problem, so we do not test result.
147
+            dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
148 148
         }
149 149
 
150 150
         $head[$h][1] .= '/';
Please login to merge, or discard this patch.
public/htdocs/core/lib/website.lib.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 {
82 82
     $str = str_replace('<?=', '<?php', $str);
83 83
     $str = str_replace('<?php', '__LTINTPHP__', $str);
84
-    $str = str_replace('<?', '<?php', $str);            // replace the short_open_tag. It is recommended to set this is Off in php.ini
84
+    $str = str_replace('<?', '<?php', $str); // replace the short_open_tag. It is recommended to set this is Off in php.ini
85 85
     $str = str_replace('__LTINTPHP__', '<?php', $str);
86 86
 
87 87
     $newstr = '';
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
             $sql .= " WHERE rowid = " . ((int) $websiteid);
471 471
 
472 472
             $resql = $db->query($sql);
473
-            if (! $resql) {
473
+            if (!$resql) {
474 474
                 return -1;
475 475
             }
476 476
         }
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
             unset($tmpwebsitepage);
558 558
         }
559 559
         if ($result > 0) {
560
-            $currenturi = $_SERVER["REQUEST_URI"];  // Example: /public/website/index.php?website=mywebsite.com&pageref=mywebsite-home&nocache=1708177483
560
+            $currenturi = $_SERVER["REQUEST_URI"]; // Example: /public/website/index.php?website=mywebsite.com&pageref=mywebsite-home&nocache=1708177483
561 561
             $regtmp = array();
562 562
             if (preg_match('/&pageref=([^&]+)/', $currenturi, $regtmp)) {
563 563
                 if ($regtmp[0] == $containerref) {
@@ -1009,9 +1009,9 @@  discard block
 block discarded – undo
1009 1009
     $sql = "SELECT COUNT(rowid) as nb";
1010 1010
     $sql .= " FROM " . MAIN_DB_PREFIX . "ecm_files";
1011 1011
     $sql .= " WHERE entity IN (" . getEntity($object->element) . ")";
1012
-    $sql .= " AND src_object_type = '" . $db->escape($object->element) . "' AND src_object_id = " . ((int) $object->id);  // Filter on object
1012
+    $sql .= " AND src_object_type = '" . $db->escape($object->element) . "' AND src_object_id = " . ((int) $object->id); // Filter on object
1013 1013
     $sql .= " AND " . $db->regexpsql('filename', $regexforimg, 1);
1014
-    $sql .= " AND share IS NOT NULL";   // Only image that are public
1014
+    $sql .= " AND share IS NOT NULL"; // Only image that are public
1015 1015
 
1016 1016
     $resql = $db->query($sql);
1017 1017
     if ($resql) {
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
     $sql = "SELECT rowid, ref, share, filename, cover, position";
1047 1047
     $sql .= " FROM " . MAIN_DB_PREFIX . "ecm_files";
1048 1048
     $sql .= " WHERE entity IN (" . getEntity($object->element) . ")";
1049
-    $sql .= " AND src_object_type = '" . $db->escape($object->element) . "' AND src_object_id = " . ((int) $object->id);  // Filter on object
1049
+    $sql .= " AND src_object_type = '" . $db->escape($object->element) . "' AND src_object_id = " . ((int) $object->id); // Filter on object
1050 1050
     $sql .= " AND " . $db->regexpsql('filename', $regexforimg, 1);
1051 1051
     $sql .= $db->order("cover,position,rowid", "ASC,ASC,ASC");
1052 1052
 
Please login to merge, or discard this patch.
public/htdocs/core/lib/usergroups.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@
 block discarded – undo
213 213
                 } else {
214 214
                     dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
215 215
                 }
216
-                dol_setcache($cachekey, $nbEvent, 120);     // If setting cache fails, this is not a problem, so we do not test result.
216
+                dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
217 217
             }
218 218
 
219 219
             $head[$h][1] .= '/';
Please login to merge, or discard this patch.
public/htdocs/core/lib/contact.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
             } else {
86 86
                 dol_print_error($db);
87 87
             }
88
-            dol_setcache($cachekey, $nbProject, 120);   // If setting cache fails, this is not a problem, so we do not test result.
88
+            dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result.
89 89
         }
90 90
         $head[$tab][0] = constant('BASE_URL') . '/contact/project.php?id=' . $object->id;
91 91
         $head[$tab][1] = $langs->trans("Projects");
Please login to merge, or discard this patch.
public/htdocs/core/lib/contract.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@
 block discarded – undo
144 144
             } else {
145 145
                 dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
146 146
             }
147
-            dol_setcache($cachekey, $nbEvent, 120);     // If setting cache fails, this is not a problem, so we do not test result.
147
+            dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
148 148
         }
149 149
 
150 150
         $head[$h][1] .= '/';
Please login to merge, or discard this patch.
public/htdocs/core/lib/order.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@
 block discarded – undo
144 144
             } else {
145 145
                 dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
146 146
             }
147
-            dol_setcache($cachekey, $nbEvent, 120);     // If setting cache fails, this is not a problem, so we do not test result.
147
+            dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
148 148
         }
149 149
 
150 150
         $head[$h][1] .= '/';
Please login to merge, or discard this patch.
public/htdocs/core/lib/payments.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     // Load translation files required by the page
201 201
     $langs->loadLangs(array('payment', 'stripe'));
202 202
 
203
-    $servicename = '';  // Link is a generic link for all payments services (paypal, stripe, ...)
203
+    $servicename = ''; // Link is a generic link for all payments services (paypal, stripe, ...)
204 204
 
205 205
     $out = img_picto('', 'globe') . ' <span class="opacitymedium">' . $langs->trans("ToOfferALinkForOnlinePayment", $servicename) . '</span><br>';
206 206
     $url = getOnlinePaymentUrl(0, $type, $ref, $amount);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
     $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT; // This is to use external domain name found into config file
251 251
     //$urlwithroot=DOL_MAIN_URL_ROOT;                   // This is to use same domain name than current
252 252
 
253
-    $urltouse = DOL_MAIN_URL_ROOT;                      // Should be "https://www.mydomain.com/mydolibarr" for example
253
+    $urltouse = DOL_MAIN_URL_ROOT; // Should be "https://www.mydomain.com/mydolibarr" for example
254 254
     //dol_syslog("getOnlinePaymentUrl DOL_MAIN_URL_ROOT=".DOL_MAIN_URL_ROOT);
255 255
 
256 256
     if ($localorexternal) {
Please login to merge, or discard this patch.
public/htdocs/core/login/functions_googleoauth.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,10 +76,10 @@
 block discarded – undo
76 76
             //global $dolibarr_main_url_root;
77 77
             //$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
78 78
             //$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
79
-            $urlwithroot = DOL_MAIN_URL_ROOT;                 // This is to use same domain name than current
79
+            $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current
80 80
 
81 81
             //$shortscope = 'userinfo_email,userinfo_profile';
82
-            $shortscope = 'openid,email,profile';   // For openid connect
82
+            $shortscope = 'openid,email,profile'; // For openid connect
83 83
 
84 84
             $oauthstateanticsrf = bin2hex(random_bytes(128 / 8));
85 85
             $_SESSION['oauthstateanticsrf'] = $shortscope . '-' . $oauthstateanticsrf;
Please login to merge, or discard this patch.