Passed
Push — main ( 324b47...7af4bb )
by Rafael
43:55
created
htdocs/core/class/CSMSFile.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
         if (!getDolGlobalString('MAIN_DISABLE_ALL_SMS')) {
151 151
             // Action according to the chose sending method
152 152
             if (getDolGlobalString('MAIN_SMS_SENDMODE')) {
153
-                $sendmode = getDolGlobalString('MAIN_SMS_SENDMODE');    // $conf->global->MAIN_SMS_SENDMODE looks like a value 'module'
154
-                $classmoduleofsender = getDolGlobalString('MAIN_MODULE_' . strtoupper($sendmode) . '_SMS', $sendmode);  // $conf->global->MAIN_MODULE_XXX_SMS looks like a value 'class@module'
153
+                $sendmode = getDolGlobalString('MAIN_SMS_SENDMODE'); // $conf->global->MAIN_SMS_SENDMODE looks like a value 'module'
154
+                $classmoduleofsender = getDolGlobalString('MAIN_MODULE_' . strtoupper($sendmode) . '_SMS', $sendmode); // $conf->global->MAIN_MODULE_XXX_SMS looks like a value 'class@module'
155 155
                 if ($classmoduleofsender == 'ovh') {
156
-                    $classmoduleofsender = 'ovhsms@ovh';    // For backward compatibility
156
+                    $classmoduleofsender = 'ovhsms@ovh'; // For backward compatibility
157 157
                 }
158 158
 
159 159
                 $tmp = explode('@', $classmoduleofsender);
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                 // Send sms method not correctly defined
210 210
                 // --------------------------------------
211 211
                 $this->error = 'Bad value for MAIN_SMS_SENDMODE constant';
212
-                $res = false;  // @phan-suppress-current-line PhanPluginRedundantAssignment
212
+                $res = false; // @phan-suppress-current-line PhanPluginRedundantAssignment
213 213
             }
214 214
         } else {
215 215
             $this->error = 'No sms sent. Feature is disabled by option MAIN_DISABLE_ALL_SMS';
Please login to merge, or discard this patch.
htdocs/core/class/fileupload.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -428,7 +428,7 @@
 block discarded – undo
428 428
         // Sanitize to avoid stream execution when calling file_size(). Not that this is a second security because
429 429
         // most streams are already disabled by stream_wrapper_unregister() in filefunc.inc.php
430 430
         $uploaded_file = preg_replace('/\s*(http|ftp)s?:/i', '', $uploaded_file);
431
-        $uploaded_file = realpath($uploaded_file);  // A hack to be sure the file point to an existing file on disk (and is not a SSRF attack)
431
+        $uploaded_file = realpath($uploaded_file); // A hack to be sure the file point to an existing file on disk (and is not a SSRF attack)
432 432
 
433 433
         $validate = $this->validate($uploaded_file, $file, $error, $index);
434 434
 
Please login to merge, or discard this patch.
htdocs/core/class/utils.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -132,14 +132,14 @@  discard block
 block discarded – undo
132 132
             if ($choice == 'allfiles') {
133 133
                 // Delete all files (except install.lock, do not follow symbolic links)
134 134
                 if ($dolibarr_main_data_root) {
135
-                    $filesarray = dol_dir_list($dolibarr_main_data_root, "all", 0, '', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1);    // No need to use recursive, we will delete directory
135
+                    $filesarray = dol_dir_list($dolibarr_main_data_root, "all", 0, '', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1); // No need to use recursive, we will delete directory
136 136
                 }
137 137
             }
138 138
 
139 139
             if ($choice == 'allfilesold') {
140 140
                 // Delete all files (except install.lock, do not follow symbolic links)
141 141
                 if ($dolibarr_main_data_root) {
142
-                    $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 1, '', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1, $nbsecondsold);   // No need to use recursive, we will delete directory
142
+                    $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 1, '', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1, $nbsecondsold); // No need to use recursive, we will delete directory
143 143
                 }
144 144
             }
145 145
 
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                         $langs->load("errors");
468 468
                         dol_syslog("Datadump retval after exec=" . $retval, LOG_ERR);
469 469
                         $errormsg = 'Error ' . $retval;
470
-                        $ok = 0;  // @phan-suppress-current-line PhanPluginRedundantAssignment
470
+                        $ok = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment
471 471
                     } else {
472 472
                         $i = 0;
473 473
                         if (!empty($output_arr)) {
@@ -1344,14 +1344,14 @@  discard block
 block discarded – undo
1344 1344
         }
1345 1345
         if ($tmpfiles && is_array($tmpfiles)) {
1346 1346
             foreach ($tmpfiles as $key => $val) {
1347
-                if ($key  == 'fullname') {
1347
+                if ($key == 'fullname') {
1348 1348
                     $filepath = array($val);
1349 1349
                     $filesize = dol_filesize($val);
1350 1350
                 }
1351
-                if ($key  == 'type') {
1351
+                if ($key == 'type') {
1352 1352
                     $mimetype = array($val);
1353 1353
                 }
1354
-                if ($key  == 'relativename') {
1354
+                if ($key == 'relativename') {
1355 1355
                     $filename = array($val);
1356 1356
                 }
1357 1357
             }
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
         if ($filepath) {
1361 1361
             if ($filesize > $sizelimit) {
1362 1362
                 $message .= '<br>' . $langs->trans("BackupIsTooLargeSend");
1363
-                $documenturl =  $dolibarr_main_url_root . '/document.php?modulepart=systemtools&atachement=1&file=backup/' . urlencode($filename[0]);
1363
+                $documenturl = $dolibarr_main_url_root . '/document.php?modulepart=systemtools&atachement=1&file=backup/' . urlencode($filename[0]);
1364 1364
                 $message .= '<br><a href=' . $documenturl . '>Lien de téléchargement</a>';
1365 1365
                 $filepath = '';
1366 1366
                 $mimetype = '';
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
         }
1433 1433
 
1434 1434
         $cron_job = new Cronjob($db);
1435
-        $cron_job->fetchAll('DESC', 't.rowid', 100, 0, 1, [], 1);   // Fetch jobs that are currently running
1435
+        $cron_job->fetchAll('DESC', 't.rowid', 100, 0, 1, [], 1); // Fetch jobs that are currently running
1436 1436
 
1437 1437
         // Iterate over all jobs in processing (this can't be this job since his state is set to 0 before)
1438 1438
         foreach ($cron_job->lines as $job_line) {
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
             }
1451 1451
 
1452 1452
             // Calling posix_kill with the 0 kill signal will return true if the process is running, false otherwise.
1453
-            if (! posix_kill($job->pid, 0)) {
1453
+            if (!posix_kill($job->pid, 0)) {
1454 1454
                 // Clean processing and pid values
1455 1455
                 $job->processing = 0;
1456 1456
                 $job->pid = null;
Please login to merge, or discard this patch.
htdocs/core/class/doleditor.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                     define('REQUIRE_CKEDITOR', '1');
159 159
                 }
160 160
 
161
-                $skin = getDolGlobalString('FCKEDITOR_SKIN', 'moono-lisa');     // default with ckeditor 4.6 : moono-lisa
161
+                $skin = getDolGlobalString('FCKEDITOR_SKIN', 'moono-lisa'); // default with ckeditor 4.6 : moono-lisa
162 162
 
163 163
                 $pluginstodisable = 'elementspath,save,flash,div,anchor';
164 164
                 if (!getDolGlobalString('FCKEDITOR_ENABLE_SPECIALCHAR')) {
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                                filebrowserImageWindowWidth : \'900\',
260 260
                                filebrowserImageWindowHeight : \'500\'';
261 261
                 }
262
-                $out .= '	})' . $morejs;    // end CKEditor.replace
262
+                $out .= '	})' . $morejs; // end CKEditor.replace
263 263
                 // Show the CKEditor javascript object once loaded is ready 'For debug)
264 264
                 //$out .= '; CKEDITOR.on(\'instanceReady\', function(ck) { ck.editor.removeMenuItem(\'maximize\'); ck.editor.removeMenuItem(\'Undo\'); ck.editor.removeMenuItem(\'undo\'); console.log(ck.editor); console.log(ck.editor.toolbar[0]); }); ';
265 265
                 $out .= '});' . "\n"; // end document.ready
Please login to merge, or discard this patch.
htdocs/core/class/dolreceiptprinter.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -944,7 +944,7 @@
 block discarded – undo
944 944
                         }
945 945
                         break;
946 946
                     default:
947
-                        $parameters = array('vals' => $vals[$tplline],'object' => $object,'nbcharactbyline' => $nbcharactbyline);
947
+                        $parameters = array('vals' => $vals[$tplline], 'object' => $object, 'nbcharactbyline' => $nbcharactbyline);
948 948
                         $action = '';
949 949
                         $reshook = $hookmanager->executeHooks('sendToPrinterAfter', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
950 950
 
Please login to merge, or discard this patch.
htdocs/core/class/conf.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
     public $liste_limit;
127 127
 
128
-    public $tzuserinputkey = 'tzserver';        // Use 'tzuserrel' to always store date in GMT and show date in time zone of user.
128
+    public $tzuserinputkey = 'tzserver'; // Use 'tzuserrel' to always store date in GMT and show date in time zone of user.
129 129
 
130 130
 
131 131
     // TODO Remove this part.
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                             $value = $_ENV['DOLIBARR_' . $key];
353 353
                         }
354 354
 
355
-                        $this->global->$key = dolDecrypt($value);   // decrypt data excrypted with dolibarr_set_const($db, $name, $value)
355
+                        $this->global->$key = dolDecrypt($value); // decrypt data excrypted with dolibarr_set_const($db, $name, $value)
356 356
 
357 357
                         if ($value && strpos($key, 'MAIN_MODULE_') === 0) {
358 358
                             $reg = array();
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
                                 // deprecated in php 8.2
409 409
                                 //if (version_compare(phpversion(), '8.2') < 0) {
410 410
                                 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
411
-                                    $this->$modulename = new stdClass();    // We need this to use the ->enabled and the ->multidir, ->dir...
411
+                                    $this->$modulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir...
412 412
                                 }
413 413
                                 $this->$modulename->enabled = true; // TODO Remove this
414 414
                                 //}
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
             }
741 741
 
742 742
             if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) {
743
-                $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0;    // Not enabled by default (still trouble of persistent tooltip)
743
+                $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0; // Not enabled by default (still trouble of persistent tooltip)
744 744
             }
745 745
 
746 746
             // By default, suppliers objects can be linked to all projects
Please login to merge, or discard this patch.
htdocs/core/class/CMailFile.class.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
                     }
351 351
                 }
352 352
                 if ($emailtoadd && preg_match('/' . preg_quote($emailtoadd, '/') . '/i', $to)) {
353
-                    $emailtoadd = '';   // Email already in the "To"
353
+                    $emailtoadd = ''; // Email already in the "To"
354 354
                 }
355 355
                 if ($emailtoadd) {
356 356
                     $listofemailstoadd[$key] = $emailtoadd;
@@ -1107,8 +1107,8 @@  discard block
 block discarded – undo
1107 1107
                     }
1108 1108
 
1109 1109
                     $smtperrorcode = 0;
1110
-                    if (! $result) {
1111
-                        $smtperrorcode = $this->smtps->lastretval;  // SMTP error code
1110
+                    if (!$result) {
1111
+                        $smtperrorcode = $this->smtps->lastretval; // SMTP error code
1112 1112
                         dol_syslog("CMailFile::sendfile: mail SMTP error code " . $smtperrorcode, LOG_WARNING);
1113 1113
 
1114 1114
                         if ($smtperrorcode == '421') {  // Try later
@@ -1126,10 +1126,10 @@  discard block
 block discarded – undo
1126 1126
                         }
1127 1127
                     }
1128 1128
 
1129
-                    $result = $this->smtps->getErrors();    // applicative error code (not SMTP error code)
1129
+                    $result = $this->smtps->getErrors(); // applicative error code (not SMTP error code)
1130 1130
                     if (empty($this->error) && empty($result)) {
1131 1131
                         dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG);
1132
-                        $res = true;  // @phan-suppress-current-line PhanPluginRedundantAssignment
1132
+                        $res = true; // @phan-suppress-current-line PhanPluginRedundantAssignment
1133 1133
                     } else {
1134 1134
                         if (empty($this->error)) {
1135 1135
                             $this->error = $result;
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 
1377 1377
         if (@is_writable($dolibarr_main_data_root)) {   // Avoid fatal error on fopen with open_basedir
1378 1378
             $outputfile = $dolibarr_main_data_root . "/dolibarr_mail.log";
1379
-            $fp = fopen($outputfile, "w");  // overwrite
1379
+            $fp = fopen($outputfile, "w"); // overwrite
1380 1380
 
1381 1381
             if ($this->sendmode == 'mail') {
1382 1382
                 fwrite($fp, $this->headers);
@@ -1634,7 +1634,7 @@  discard block
 block discarded – undo
1634 1634
             // Similar code to forge a text from html is also in smtps.class.php
1635 1635
             $strContentAltText = preg_replace("/<br\s*[^>]*>/", " ", $strContent);
1636 1636
             // TODO We could replace <img ...> with [Filename.ext] like Gmail do.
1637
-            $strContentAltText = html_entity_decode(strip_tags($strContentAltText));    // Remove any HTML tags
1637
+            $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags
1638 1638
             $strContentAltText = trim(wordwrap($strContentAltText, 75, !getDolGlobalString('MAIN_FIX_FOR_BUGGED_MTA') ? "\r\n" : "\n"));
1639 1639
 
1640 1640
             // Check if html header already in message, if not complete the message
@@ -2019,7 +2019,7 @@  discard block
 block discarded – undo
2019 2019
                 // We save the image to send in disk
2020 2020
                 $filecontent = $matches[2][$key];
2021 2021
 
2022
-                $cid = 'cid000' . dol_hash($filecontent, 'md5');      // The id must not change if image is same
2022
+                $cid = 'cid000' . dol_hash($filecontent, 'md5'); // The id must not change if image is same
2023 2023
 
2024 2024
                 $destfiletmp = $images_dir . '/' . $cid . '.' . $ext;
2025 2025
 
Please login to merge, or discard this patch.
htdocs/core/class/vcard.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     {
136 136
         // $type = "GIF" | "JPEG"
137 137
         //$this->properties["PHOTO;MEDIATYPE=$type;ENCODING=BASE64"] = base64_encode($photo);
138
-        $this->properties["PHOTO;MEDIATYPE=$type"] = $photo;        // must be url of photo
138
+        $this->properties["PHOTO;MEDIATYPE=$type"] = $photo; // must be url of photo
139 139
         //$this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo);   // must be content of image
140 140
     }
141 141
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
     public function getVCard()
360 360
     {
361 361
         $text = "BEGIN:VCARD\r\n";
362
-        $text .= "VERSION:4.0\r\n";     // With V4, all encoding are UTF-8
362
+        $text .= "VERSION:4.0\r\n"; // With V4, all encoding are UTF-8
363 363
         //$text.= "VERSION:2.1\r\n";
364 364
         foreach ($this->properties as $key => $value) {
365 365
             $newkey = preg_replace('/-.*$/', '', $key); // remove suffix -twitter, -facebook, ...
Please login to merge, or discard this patch.
htdocs/core/modules/delivery/doc/pdf_storm.modules.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -822,7 +822,7 @@
 block discarded – undo
822 822
             if ($this->page_largeur < 210) {
823 823
                 $widthrecbox = 84; // To work with US executive format
824 824
             }
825
-            $posy = 42;  // @phan-suppress-current-line PhanPluginRedundantAssignment
825
+            $posy = 42; // @phan-suppress-current-line PhanPluginRedundantAssignment
826 826
             $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
827 827
             if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
828 828
                 $posx = $this->marge_gauche;
Please login to merge, or discard this patch.