Passed
Pull Request — dev (#14)
by Rafael
51:23
created
Dolibarr/Code/Accountancy/Classes/AccountancyExport.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2545,14 +2545,14 @@
 block discarded – undo
2545 2545
     }
2546 2546
 
2547 2547
     /**
2548
-    * Export format : iSuite Expert
2549
-    *
2550
-    * by OpenSolus [https://opensolus.fr]
2551
-    *
2548
+     * Export format : iSuite Expert
2549
+     *
2550
+     * by OpenSolus [https://opensolus.fr]
2551
+     *
2552 2552
      * @param   array       $objectLines            data
2553 2553
      * @param   resource    $exportFile             [=null] File resource to export or print if null
2554 2554
      * @return  void
2555
-    */
2555
+     */
2556 2556
     public function exportiSuiteExpert($objectLines, $exportFile = null)
2557 2557
     {
2558 2558
         $separator = ';';
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -335,8 +335,8 @@  discard block
 block discarded – undo
335 335
      */
336 336
     public function export(&$TData, $formatexportset, $withAttachment = 0, $downloadMode = 0, $outputMode = 0, $noouput = 0)
337 337
     {
338
-        global $db, $conf, $langs;  // The tpl file use $db
339
-        global $search_date_end;    // Used into /accountancy/tpl/export_journal.tpl.php
338
+        global $db, $conf, $langs; // The tpl file use $db
339
+        global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php
340 340
 
341 341
         // Define name of file to save
342 342
         $filename = 'general_ledger-' . $this->getFormatCode($formatexportset);
@@ -2001,7 +2001,7 @@  discard block
 block discarded – undo
2001 2001
             // MOPM
2002 2002
             $tab[] = "";
2003 2003
             // BONP
2004
-            $tab[] =  "";
2004
+            $tab[] = "";
2005 2005
             // BQAF
2006 2006
             $tab[] = "";
2007 2007
             // ECES
@@ -2207,7 +2207,7 @@  discard block
 block discarded – undo
2207 2207
                 }
2208 2208
             } elseif ($line->doc_type == 'customer_invoice') {
2209 2209
                 if (($line->amount) < 0) {
2210
-                    $nature_piece = 'AC';       // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign.
2210
+                    $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign.
2211 2211
                 } else {
2212 2212
                     $nature_piece = 'FC';
2213 2213
                 }
Please login to merge, or discard this patch.
Dolibarr/Code/Accountancy/Classes/BookKeeping.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1987,7 +1987,7 @@  discard block
 block discarded – undo
1987 1987
         return 1;
1988 1988
     }
1989 1989
 
1990
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1990
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
1991 1991
     /**
1992 1992
      * Export bookkeeping
1993 1993
      *
@@ -1996,7 +1996,7 @@  discard block
 block discarded – undo
1996 1996
      */
1997 1997
     public function export_bookkeeping($model = 'ebp')
1998 1998
     {
1999
-		// phpcs:enable
1999
+        // phpcs:enable
2000 2000
         global $conf;
2001 2001
 
2002 2002
         $sql = "SELECT rowid, doc_date, doc_type,";
@@ -2180,7 +2180,7 @@  discard block
 block discarded – undo
2180 2180
         */
2181 2181
     }
2182 2182
 
2183
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2183
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2184 2184
     /**
2185 2185
      * Return list of accounts with label by chart of accounts
2186 2186
      *
@@ -2195,7 +2195,7 @@  discard block
 block discarded – undo
2195 2195
      */
2196 2196
     public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
2197 2197
     {
2198
-		// phpcs:enable
2198
+        // phpcs:enable
2199 2199
         global $conf;
2200 2200
 
2201 2201
         require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/accounting.lib.php';
@@ -2292,7 +2292,7 @@  discard block
 block discarded – undo
2292 2292
         }
2293 2293
     }
2294 2294
 
2295
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2295
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2296 2296
     /**
2297 2297
      * Description of accounting account
2298 2298
      *
@@ -2301,7 +2301,7 @@  discard block
 block discarded – undo
2301 2301
      */
2302 2302
     public function get_compte_desc($account = null)
2303 2303
     {
2304
-		// phpcs:enable
2304
+        // phpcs:enable
2305 2305
         global $conf;
2306 2306
 
2307 2307
         $pcgver = getDolGlobalInt('CHARTOFACCOUNTS');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1731,7 +1731,7 @@
 block discarded – undo
1731 1731
         $sql = "DELETE";
1732 1732
         $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element . $mode;
1733 1733
         $sql .= " WHERE piece_num = " . (int) $piecenum;
1734
-        $sql .= " AND date_validated IS NULL";      // For security, exclusion of validated entries at the time of deletion
1734
+        $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion
1735 1735
         $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features
1736 1736
         $sql .= $sql_filter;
1737 1737
 
Please login to merge, or discard this patch.
Dolibarr/Code/Accountancy/Classes/AccountingAccount.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
         return $this->LibStatut($this->status, $mode);
699 699
     }
700 700
 
701
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
701
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
702 702
     /**
703 703
      *  Return the label of a given status
704 704
      *
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
      */
709 709
     public function LibStatut($status, $mode = 0)
710 710
     {
711
-		// phpcs:enable
711
+        // phpcs:enable
712 712
         if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
713 713
             global $langs;
714 714
             $langs->load("users");
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
         $hookmanager->initHooks(array('accountancyBindingCalculation'));
745 745
 
746 746
         // Execute hook accountancyBindingCalculation
747
-        $parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount' => $accountingAccount, 0 => $type);
747
+        $parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet, 'accountingAccount' => $accountingAccount, 0 => $type);
748 748
         $reshook = $hookmanager->executeHooks('accountancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks
749 749
 
750 750
         if (empty($reshook)) {
@@ -758,9 +758,9 @@  discard block
 block discarded – undo
758 758
             require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/company.lib.php';
759 759
             $isBuyerInEEC = isInEEC($buyer);
760 760
             $isSellerInEEC = isInEEC($seller);
761
-            $code_l = '';   // Default value for generic product/service
762
-            $code_p = '';   // Value for the product/service in parameter ($product)
763
-            $code_t = '';   // Default value of product account for the thirdparty
761
+            $code_l = ''; // Default value for generic product/service
762
+            $code_p = ''; // Value for the product/service in parameter ($product)
763
+            $code_t = ''; // Default value of product account for the thirdparty
764 764
             $suggestedid = '';
765 765
 
766 766
             // Level 1 (define $code_l): Search suggested default account for product/service
Please login to merge, or discard this patch.
Dolibarr/Code/Accountancy/Classes/AccountancyCategory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -639,7 +639,7 @@
 block discarded – undo
639 639
         if (is_array($cpt)) {
640 640
             $listofaccount = '';
641 641
             foreach ($cpt as $cptcursor) {
642
-                if (! is_null($cptcursor)) {
642
+                if (!is_null($cptcursor)) {
643 643
                     if ($listofaccount) {
644 644
                         $listofaccount .= ",";
645 645
                     }
Please login to merge, or discard this patch.
Dolibarr/Code/Accountancy/Classes/Lettering.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -318,11 +318,15 @@
 block discarded – undo
318 318
         $resql = $this->db->query($sql);
319 319
         if ($resql) {
320 320
             while ($obj = $this->db->fetch_object($resql)) {
321
-                if (empty($obj->lettering_code)) continue;
321
+                if (empty($obj->lettering_code)) {
322
+                    continue;
323
+                }
322 324
 
323 325
                 // Remove normal lettering code if set partial lettering
324 326
                 if ($partial && preg_match('/^[A-Z]+$/', $obj->lettering_code)) {
325
-                    if (!empty($obj->bookkeeping_ids)) $ids = array_diff($ids, explode(',', $obj->bookkeeping_ids));
327
+                    if (!empty($obj->bookkeeping_ids)) {
328
+                        $ids = array_diff($ids, explode(',', $obj->bookkeeping_ids));
329
+                    }
326 330
                 } elseif (!$partial && preg_match('/^[a-z]+$/', $obj->lettering_code)) {
327 331
                     // Delete partial lettering code if set normal lettering
328 332
                     $sql2 = "UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping SET";
Please login to merge, or discard this patch.
Dolibarr/Code/Api/Classes/DolibarrApiAccess.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         $this->db = $db;
82 82
     }
83 83
 
84
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName
84
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName
85 85
     /**
86 86
      * Check access
87 87
      *
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function __isAllowed()
94 94
     {
95
-		// phpcs:enable
95
+        // phpcs:enable
96 96
         global $conf, $db, $user;
97 97
 
98 98
         $login = '';
@@ -229,13 +229,13 @@  discard block
 block discarded – undo
229 229
         return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
230 230
     }
231 231
 
232
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName
232
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName
233 233
     /**
234 234
      * @return string string to be used with WWW-Authenticate header
235 235
      */
236 236
     public function __getWWWAuthenticateString()
237 237
     {
238
-		// phpcs:enable
238
+        // phpcs:enable
239 239
         return '';
240 240
     }
241 241
 
Please login to merge, or discard this patch.
Dolibarr/Code/Api/Api/Setup.php 2 patches
Indentation   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
         return $list;
725 725
     }
726 726
 
727
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
727
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
728 728
     /**
729 729
      * Clean sensible object datas
730 730
      *
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
      */
734 734
     protected function _cleanObjectDatas($object)
735 735
     {
736
-		// phpcs:enable
736
+        // phpcs:enable
737 737
         $object = parent::_cleanObjectDatas($object);
738 738
 
739 739
         unset($object->error);
@@ -1401,7 +1401,6 @@  discard block
 block discarded – undo
1401 1401
     }
1402 1402
 
1403 1403
     /**
1404
-
1405 1404
      * Update Extrafield object
1406 1405
      *
1407 1406
      * @param   string  $attrname       extrafield attrname
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
                     $list[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed;
1176 1176
                     $list[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique;
1177 1177
                     $list[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired;
1178
-                    $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : '');    // This may be a string encoded with serialise() or json_encode()
1178
+                    $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode()
1179 1179
                     $list[$tab->elementtype][$tab->name]['pos'] = $tab->pos;
1180 1180
                     $list[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable;
1181 1181
                     $list[$tab->elementtype][$tab->name]['perms'] = $tab->perms;
@@ -1285,7 +1285,7 @@  discard block
 block discarded – undo
1285 1285
                     $answer[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed;
1286 1286
                     $answer[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique;
1287 1287
                     $answer[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired;
1288
-                    $answer[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : '');  // This may be a string encoded with serialise() or json_encode()
1288
+                    $answer[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode()
1289 1289
                     $answer[$tab->elementtype][$tab->name]['pos'] = $tab->pos;
1290 1290
                     $answer[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable;
1291 1291
                     $answer[$tab->elementtype][$tab->name]['perms'] = $tab->perms;
@@ -2410,7 +2410,7 @@  discard block
 block discarded – undo
2410 2410
                 throw new RestException(500, $langs->trans('XmlNotFound') . ': /install/' . $xmlshortfile);
2411 2411
             }
2412 2412
         } else {
2413
-            $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0);    // Accept http or https links on external remote server only. Same is used into filecheck.php.
2413
+            $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php.
2414 2414
 
2415 2415
             // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
2416 2416
             if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
Please login to merge, or discard this patch.
Dolibarr/Core/Base/DolibarrApi.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -158,11 +158,11 @@
 block discarded – undo
158 158
         unset($object->barcode_type_code);
159 159
         unset($object->barcode_type_label);
160 160
 
161
-        unset($object->mode_reglement);     // We use mode_reglement_id now
162
-        unset($object->cond_reglement);     // We use cond_reglement_id now
163
-        unset($object->note);               // We use note_public or note_private now
164
-        unset($object->contact);            // We use contact_id now
165
-        unset($object->thirdparty);         // We use thirdparty_id or fk_soc or socid now
161
+        unset($object->mode_reglement); // We use mode_reglement_id now
162
+        unset($object->cond_reglement); // We use cond_reglement_id now
163
+        unset($object->note); // We use note_public or note_private now
164
+        unset($object->contact); // We use contact_id now
165
+        unset($object->thirdparty); // We use thirdparty_id or fk_soc or socid now
166 166
 
167 167
         unset($object->projet); // Should be fk_project
168 168
         unset($object->project); // Should be fk_project
Please login to merge, or discard this patch.
Dolibarr/Core/Trait/DolDeprecationHandler.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
             return $this->$newProperty;
61 61
         }
62 62
         if ($this->isDynamicPropertiesEnabled()) {
63
-            return null;  // If the property is set, then __get is not called.
63
+            return null; // If the property is set, then __get is not called.
64 64
         }
65 65
         $msg = "DolDeprecationHandler: Undefined property '" . $name . "'" . self::getCallerInfoString();
66 66
         dol_syslog($msg);
67 67
         trigger_error($msg, E_USER_NOTICE);
68
-        return $this->$name;  // Returning value anyway (graceful degradation)
68
+        return $this->$name; // Returning value anyway (graceful degradation)
69 69
     }
70 70
 
71 71
     /**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         if (!$this->isDynamicPropertiesEnabled()) {
96 96
             $msg = "DolDeprecationHandler: Undefined property '" . $name . "'" . self::getCallerInfoString();
97 97
             trigger_error($msg, E_USER_NOTICE);
98
-            $this->$name = $value;  // Setting anyway for graceful degradation
98
+            $this->$name = $value; // Setting anyway for graceful degradation
99 99
         } else {
100 100
             $this->$name = $value;
101 101
         }
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
         if (property_exists($this, 'enableDeprecatedReporting')) {
194 194
             // If the property exists, then we use it.
195
-            return (bool)$this->enableDeprecatedReporting;
195
+            return (bool) $this->enableDeprecatedReporting;
196 196
         }
197 197
 
198 198
         return (error_reporting() & E_DEPRECATED) === E_DEPRECATED;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
         if (property_exists($this, 'enableDynamicProperties')) {
211 211
             // If the property exists, then we use it.
212
-            return (bool)$this->enableDynamicProperties;
212
+            return (bool) $this->enableDynamicProperties;
213 213
         }
214 214
 
215 215
         // Otherwise it depends on a choice
Please login to merge, or discard this patch.