Passed
Push — EXTRACT_CLASSES ( a2ff75...ae6b5c )
by Rafael
34:15
created
public/htdocs/install/repair.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1171,13 +1171,13 @@  discard block
 block discarded – undo
1171 1171
                             }
1172 1172
                             if ($key == 'js') {
1173 1173
                                 $value = $obj->value;
1174
-                                $valuearray = (array) json_decode($value);  // Force cast into array because sometimes it is a stdClass
1174
+                                $valuearray = (array) json_decode($value); // Force cast into array because sometimes it is a stdClass
1175 1175
                                 $reloffile = $valuearray[0];
1176 1176
                                 $reloffile = preg_replace('/^\//', '', $valuearray[0]);
1177 1177
                             }
1178 1178
                             if ($key == 'css') {
1179 1179
                                 $value = $obj->value;
1180
-                                $valuearray = (array) json_decode($value);  // Force cast into array because sometimes it is a stdClass
1180
+                                $valuearray = (array) json_decode($value); // Force cast into array because sometimes it is a stdClass
1181 1181
                                 if ($value && (!is_array($valuearray) || count($valuearray) == 0)) {
1182 1182
                                     $valuearray = array();
1183 1183
                                     $valuearray[0] = $value; // If value was not a json array but a string
@@ -1193,7 +1193,7 @@  discard block
 block discarded – undo
1193 1193
                                     $result = 'found'; // If error, we force like if we found to avoid any deletion
1194 1194
                                 }
1195 1195
                             } else {
1196
-                                $result = 'found';  //
1196
+                                $result = 'found'; //
1197 1197
                             }
1198 1198
 
1199 1199
                             if (!$result) {
@@ -1572,7 +1572,7 @@  discard block
 block discarded – undo
1572 1572
 
1573 1573
                     $sql_attach = 'INSERT INTO ' . MAIN_DB_PREFIX . 'receptiondet_batch';
1574 1574
                     $sql_attach .= ' (fk_element, fk_product, fk_elementdet, qty, fk_entrepot, fk_user, datec, comment, status, tms, batch, eatby, sellby)';
1575
-                    $sql_attach .= " VALUES (" . $sql_attach_values . ")";  // The string is already sanitized
1575
+                    $sql_attach .= " VALUES (" . $sql_attach_values . ")"; // The string is already sanitized
1576 1576
                 }
1577 1577
 
1578 1578
                 if ($repair_link_dispatch_lines_supplier_order_lines == 'confirmed') {
Please login to merge, or discard this patch.
websites/website_template-homesubmenu/containers/manifest.json.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php // BEGIN PHP
2 2
 $websitekey = basename(__DIR__);
3
-if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; 
3
+if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; 
4 4
 } // Load env if not already loaded
5 5
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/website.lib.php';
6 6
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/website.inc.php';
Please login to merge, or discard this patch.
websites/website_template-homesubmenu/containers/styles.css.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php // BEGIN PHP
2 2
 $websitekey = basename(__DIR__);
3
-if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; 
3
+if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; 
4 4
 } // Load env if not already loaded
5 5
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/website.lib.php';
6 6
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/website.inc.php';
7 7
 ob_start();
8
-if (! headers_sent()) { /* because file is included inline when in edit mode and we don't want warning */
8
+if (!headers_sent()) { /* because file is included inline when in edit mode and we don't want warning */
9 9
 header('Cache-Control: max-age=3600, public, must-revalidate');
10 10
 header('Content-type: text/css');
11 11
 }
Please login to merge, or discard this patch.
doctemplates/websites/website_template-noimg/containers/manifest.json.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php 
2 2
 // BEGIN PHP
3 3
 $websitekey = basename(__DIR__);
4
-if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; 
4
+if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; 
5 5
 } // Load env if not already loaded
6 6
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/website.lib.php';
7 7
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/website.inc.php';
Please login to merge, or discard this patch.
public/htdocs/install/upgrade2.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4211,7 +4211,7 @@  discard block
 block discarded – undo
4211 4211
 
4212 4212
     if (!is_object($user)) {
4213 4213
         include_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
4214
-        $user = new User($db);  // To avoid error during migration
4214
+        $user = new User($db); // To avoid error during migration
4215 4215
     }
4216 4216
 
4217 4217
     dolibarr_install_syslog("upgrade2::migrate_reload_modules force=" . $force . ", listofmodule=" . implode(',', array_keys($listofmodule)));
@@ -5042,7 +5042,7 @@  discard block
 block discarded – undo
5042 5042
                 $error++;
5043 5043
             }
5044 5044
 
5045
-            $current_contract =  $obj->cid;
5045
+            $current_contract = $obj->cid;
5046 5046
         }
5047 5047
     } else {
5048 5048
         $error++;
Please login to merge, or discard this patch.
public/htdocs/install/check.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                     $conf->db->name = $dolibarr_main_db_name;
361 361
                     $conf->db->user = $dolibarr_main_db_user;
362 362
                     $conf->db->pass = $dolibarr_main_db_pass;
363
-                    $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, (int)$conf->db->port);
363
+                    $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, (int) $conf->db->port);
364 364
                     if ($db->connected && $db->database_selected) {
365 365
                         $ok = true;
366 366
                     }
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
             $allowupgrade = true;
458 458
         }
459 459
 
460
-        $dir = DOL_DOCUMENT_ROOT . "/install/mysql/migration/";   // We use mysql migration scripts whatever is database driver
460
+        $dir = DOL_DOCUMENT_ROOT . "/install/mysql/migration/"; // We use mysql migration scripts whatever is database driver
461 461
         dolibarr_install_syslog("Scan sql files for migration files in " . $dir);
462 462
 
463 463
         // Get files list of migration file x.y.z-a.b.c.sql into /install/mysql/migration
Please login to merge, or discard this patch.
public/htdocs/install/inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     echo "      Display this help message.\n";
125 125
 }
126 126
 
127
-if (php_sapi_name() === "cli" && (float)PHP_VERSION > 7.0) {
127
+if (php_sapi_name() === "cli" && (float) PHP_VERSION > 7.0) {
128 128
     $rest_index = 0;
129 129
     $opts = getopt($short_options, $long_options, $rest_index);
130 130
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
          * @param string $arg
150 150
          * @return bool
151 151
          */
152
-        static function ($arg) {
152
+        static function($arg) {
153 153
             return strlen($arg) >= 2 && $arg[0] == '-';
154 154
         }
155 155
     );
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      * @param string $arg
160 160
      * @return string
161 161
      */
162
-        static function ($arg) {
162
+        static function($arg) {
163 163
             if (strlen($arg) > 1) {
164 164
                 return "--" . $arg;
165 165
             }
@@ -294,10 +294,10 @@  discard block
 block discarded – undo
294 294
 
295 295
 // Check install.lock (for both install and upgrade)
296 296
 
297
-$lockfile = DOL_DATA_ROOT . '/install.lock';    // To lock all /install pages
298
-$lockfile2 = DOL_DOCUMENT_ROOT . '/install.lock';    // To lock all /install pages (recommended)
299
-$upgradeunlockfile = DOL_DATA_ROOT . '/upgrade.unlock';    // To unlock upgrade process
300
-$upgradeunlockfile2 = DOL_DOCUMENT_ROOT . '/upgrade.unlock';    // To unlock upgrade process
297
+$lockfile = DOL_DATA_ROOT . '/install.lock'; // To lock all /install pages
298
+$lockfile2 = DOL_DOCUMENT_ROOT . '/install.lock'; // To lock all /install pages (recommended)
299
+$upgradeunlockfile = DOL_DATA_ROOT . '/upgrade.unlock'; // To unlock upgrade process
300
+$upgradeunlockfile2 = DOL_DOCUMENT_ROOT . '/upgrade.unlock'; // To unlock upgrade process
301 301
 if (constant('DOL_DATA_ROOT') === null) {
302 302
     // We don't have a configuration file yet
303 303
     // Try to detect any lockfile in the default documents path
Please login to merge, or discard this patch.
public/htdocs/install/step2.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 // Only works if you are not in safe_mode. / Ne fonctionne que si on est pas en safe_mode.
43 43
 
44 44
 $err = error_reporting();
45
-error_reporting(0);      // Disable all errors
45
+error_reporting(0); // Disable all errors
46 46
 //error_reporting(E_ALL);
47
-@set_time_limit(1800);   // Need 1800 on some very slow OS like Windows 7/64
47
+@set_time_limit(1800); // Need 1800 on some very slow OS like Windows 7/64
48 48
 error_reporting($err);
49 49
 
50 50
 $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : (empty($argv[1]) ? '' : $argv[1]);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 dolibarr_install_syslog("--- step2: entering step2.php page");
95 95
 
96
-'@phan-var-force string $dolibarr_main_db_prefix';  // From configuraiotn file or install/inc.php
96
+'@phan-var-force string $dolibarr_main_db_prefix'; // From configuraiotn file or install/inc.php
97 97
 
98 98
 /*
99 99
  *	View
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     print '<table cellspacing="0" style="padding: 4px 4px 4px 0" border="0" width="100%">';
115 115
     $error = 0;
116 116
 
117
-    $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, (int)$conf->db->port);
117
+    $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, (int) $conf->db->port);
118 118
 
119 119
     if ($db->connected) {
120 120
         print "<tr><td>";
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 
600 600
 $conf->file->instance_unique_id = (empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id); // Unique id of instance
601 601
 
602
-$hash_unique_id = dol_hash('dolibarr' . $conf->file->instance_unique_id, 'sha256');   // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only.
602
+$hash_unique_id = dol_hash('dolibarr' . $conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only.
603 603
 
604 604
 $out = '<input type="checkbox" name="dolibarrpingno" id="dolibarrpingno"' . ((getDolGlobalString('MAIN_FIRST_PING_OK_ID') == 'disabled') ? '' : ' value="checked" checked="true"') . '> ';
605 605
 $out .= '<label for="dolibarrpingno">' . $langs->trans("MakeAnonymousPing") . '</label>';
Please login to merge, or discard this patch.
public/htdocs/install/step1.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,8 +99,9 @@
 block discarded – undo
99 99
             $main_data_dir = $argv[4]; // override when executing the script in command line
100 100
         }
101 101
         // In mode 3 the main_url is custom
102
-        if ($force_install_noedit != 3)
103
-        $main_url = detect_dolibarr_main_url_root();
102
+        if ($force_install_noedit != 3) {
103
+                $main_url = detect_dolibarr_main_url_root();
104
+        }
104 105
         if (!empty($argv[5])) {
105 106
             $main_url = $argv[5]; // override when executing the script in command line
106 107
         }
Please login to merge, or discard this patch.