Passed
Push — FUNCTIONS_LIB_REVIEW_240920 ( 00d68f )
by Rafael
49:46
created
Dolibarr/Code/Projet/Api/Tasks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             if ($search_sale == -2) {
105 105
                 $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
106 106
             } elseif ($search_sale > 0) {
107
-                $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")";
107
+                $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")";
108 108
             }
109 109
         }
110 110
         // Add sql filters
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
             }
499 499
             if ($field == 'array_options' && is_array($value)) {
500 500
                 foreach ($value as $index => $val) {
501
-                    $this->task->array_options[$index] = $this->_checkValForAPI($field, $val, $this->task);;
501
+                    $this->task->array_options[$index] = $this->_checkValForAPI($field, $val, $this->task); ;
502 502
                 }
503 503
                 continue;
504 504
             }
Please login to merge, or discard this patch.
Dolibarr/Code/ComptaFacture/Api/Invoices.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -372,18 +372,18 @@  discard block
 block discarded – undo
372 372
     }
373 373
 
374 374
     /**
375
-    * Create an invoice using a contract.
376
-    *
377
-    * @param int   $contractid       Id of the contract
375
+     * Create an invoice using a contract.
376
+     *
377
+     * @param int   $contractid       Id of the contract
378 378
      * @return     array                          Object with cleaned properties
379
-    *
380
-    * @url     POST /createfromcontract/{contractid}
381
-    *
382
-    * @throws RestException 400
383
-    * @throws RestException 401
384
-    * @throws RestException 404
385
-    * @throws RestException 405
386
-    */
379
+     *
380
+     * @url     POST /createfromcontract/{contractid}
381
+     *
382
+     * @throws RestException 400
383
+     * @throws RestException 401
384
+     * @throws RestException 404
385
+     * @throws RestException 405
386
+     */
387 387
     public function createInvoiceFromContract($contractid)
388 388
     {
389 389
     
@@ -1732,7 +1732,7 @@  discard block
 block discarded – undo
1732 1732
         ];
1733 1733
     }
1734 1734
 
1735
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
1735
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
1736 1736
     /**
1737 1737
      * Clean sensible object datas
1738 1738
      *
@@ -1741,7 +1741,7 @@  discard block
 block discarded – undo
1741 1741
      */
1742 1742
     protected function _cleanObjectDatas($object)
1743 1743
     {
1744
-		// phpcs:enable
1744
+        // phpcs:enable
1745 1745
         $object = parent::_cleanObjectDatas($object);
1746 1746
 
1747 1747
         unset($object->note);
@@ -1835,7 +1835,7 @@  discard block
 block discarded – undo
1835 1835
     }
1836 1836
 
1837 1837
 
1838
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
1838
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
1839 1839
     /**
1840 1840
      * Clean sensible object datas
1841 1841
      *
@@ -1844,7 +1844,7 @@  discard block
 block discarded – undo
1844 1844
      */
1845 1845
     protected function _cleanTemplateObjectDatas($object)
1846 1846
     {
1847
-		// phpcs:enable
1847
+        // phpcs:enable
1848 1848
         $object = parent::_cleanObjectDatas($object);
1849 1849
 
1850 1850
         unset($object->note);
Please login to merge, or discard this patch.
Dolibarr/Code/Adherents/Api/Members.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -275,11 +275,11 @@
 block discarded – undo
275 275
         }
276 276
         $sql .= ' WHERE t.entity IN (' . getEntity('adherent') . ')';
277 277
         if (!empty($typeid)) {
278
-            $sql .= ' AND t.fk_adherent_type=' . ((int)$typeid);
278
+            $sql .= ' AND t.fk_adherent_type=' . ((int) $typeid);
279 279
         }
280 280
         // Select members of given category
281 281
         if ($category > 0) {
282
-            $sql .= " AND c.fk_categorie = " . ((int)$category);
282
+            $sql .= " AND c.fk_categorie = " . ((int) $category);
283 283
             $sql .= " AND c.fk_member = t.rowid";
284 284
         }
285 285
         // Add sql filters
Please login to merge, or discard this patch.
Dolibarr/Code/ComptaBank/Api/BankAccounts.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
         return $account;
407 407
     }
408 408
 
409
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
409
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
410 410
     /**
411 411
      * Clean sensible object datas
412 412
      *
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
      */
416 416
     protected function _cleanObjectDatas($object)
417 417
     {
418
-		// phpcs:enable
418
+        // phpcs:enable
419 419
         $object = parent::_cleanObjectDatas($object);
420 420
 
421 421
         unset($object->rowid);
Please login to merge, or discard this patch.
Dolibarr/Code/ProductStock/Api/Warehouses.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
         $sql .= ' WHERE t.entity IN (' . getEntity('stock') . ')';
90 90
         // Select warehouses of given category
91 91
         if ($category > 0) {
92
-            $sql .= " AND c.fk_categorie = " . ((int)$category);
92
+            $sql .= " AND c.fk_categorie = " . ((int) $category);
93 93
             $sql .= " AND c.fk_warehouse = t.rowid ";
94 94
         }
95 95
         // Add sql filters
Please login to merge, or discard this patch.
Dolibarr/Code/ProductStock/Api/StockMovements.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      * $price Can be set to update AWP (Average Weighted Price) when you make a stock increase
157 157
      * $dlc Eat-by date. Will be used if lot does not exists yet and will be created.
158 158
      * $dluo Sell-by date. Will be used if lot does not exists yet and will be created.
159
-         *
159
+     *
160 160
      * @param int $product_id Id product id {@min 1} {@from body} {@required true}
161 161
      * @param int $warehouse_id Id warehouse {@min 1} {@from body} {@required true}
162 162
      * @param float $qty Qty to add (Use negative value for a stock decrease) {@from body} {@required true}
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
 
280 280
 
281
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
281
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
282 282
     /**
283 283
      * Clean sensible object datas
284 284
      *
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
      */
288 288
     protected function _cleanObjectDatas($object)
289 289
     {
290
-		// phpcs:enable
290
+        // phpcs:enable
291 291
         $object = parent::_cleanObjectDatas($object);
292 292
 
293 293
         // Remove useless data
Please login to merge, or discard this patch.
Dolibarr/Code/CommPropale/Api/Proposals.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
     }
962 962
 
963 963
 
964
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
964
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
965 965
     /**
966 966
      * Clean sensible object datas
967 967
      *
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
      */
971 971
     protected function _cleanObjectDatas($object)
972 972
     {
973
-		// phpcs:enable
973
+        // phpcs:enable
974 974
         $object = parent::_cleanObjectDatas($object);
975 975
 
976 976
         unset($object->note);
Please login to merge, or discard this patch.
Dolibarr/Code/WebHook/Api/WebHook.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,9 +134,9 @@
 block discarded – undo
134 134
 
135 135
             $obj_ret['data'] = $tmp;
136 136
             $obj_ret['pagination'] = [
137
-                'total' => (int)$total,
137
+                'total' => (int) $total,
138 138
                 'page' => $page, //count starts from 0
139
-                'page_count' => ceil((int)$total / $limit),
139
+                'page_count' => ceil((int) $total / $limit),
140 140
                 'limit' => $limit
141 141
             ];
142 142
         }
Please login to merge, or discard this patch.
public/htdocs/accountancy/bookkeeping/listbyaccount.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     if ($search_account_category != '-1' && !empty($search_account_category)) {
317 317
         $accountingcategory = new AccountancyCategory($db);
318 318
 
319
-        $listofaccountsforgroup = $accountingcategory->getCptsCat(0, 'fk_accounting_category = ' . ((int)$search_account_category));
319
+        $listofaccountsforgroup = $accountingcategory->getCptsCat(0, 'fk_accounting_category = ' . ((int) $search_account_category));
320 320
         $listofaccountsforgroup2 = array();
321 321
         if (is_array($listofaccountsforgroup)) {
322 322
             foreach ($listofaccountsforgroup as $tmpval) {
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             }
325 325
         }
326 326
         $filter['t.search_accounting_code_in'] = implode(',', $listofaccountsforgroup2);
327
-        $param .= '&search_account_category=' . urlencode((string)($search_account_category));
327
+        $param .= '&search_account_category=' . urlencode((string) ($search_account_category));
328 328
     }
329 329
     if (!empty($search_accountancy_code_start)) {
330 330
         if ($type == 'sub') {
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
     }
349 349
     if (!empty($search_mvt_num)) {
350 350
         $filter['t.piece_num'] = $search_mvt_num;
351
-        $param .= '&search_mvt_num=' . urlencode((string)($search_mvt_num));
351
+        $param .= '&search_mvt_num=' . urlencode((string) ($search_mvt_num));
352 352
     }
353 353
     if (!empty($search_doc_ref)) {
354 354
         $filter['t.doc_ref'] = $search_doc_ref;
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
         $result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter, 'AND', 0);
635 635
     }
636 636
     //$num = count($object->lines);
637
-    $num = $result;                     // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit
637
+    $num = $result; // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit
638 638
 
639 639
     if ($result < 0) {
640 640
         setEventMessages($object->error, $object->errors, 'errors');
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
     $param .= '&contextpage=' . urlencode($contextpage);
745 745
 }
746 746
 if ($limit > 0 && $limit != $conf->liste_limit) {
747
-    $param .= '&limit=' . ((int)$limit);
747
+    $param .= '&limit=' . ((int) $limit);
748 748
 }
749 749
 
750 750
 print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
@@ -1051,8 +1051,8 @@  discard block
 block discarded – undo
1051 1051
     }
1052 1052
     //if (empty($accountg)) $accountg = '-';
1053 1053
 
1054
-    $colspan = 0;           // colspan before field 'label of operation'
1055
-    $colspanend = 0;        // colspan after debit/credit
1054
+    $colspan = 0; // colspan before field 'label of operation'
1055
+    $colspanend = 0; // colspan after debit/credit
1056 1056
     if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1057 1057
         $colspan++;
1058 1058
     }
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
         if (!$i) {
1316 1316
             $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit';
1317 1317
         }
1318
-        $totalarray['val']['totaldebit'] += (float)$line->debit;
1318
+        $totalarray['val']['totaldebit'] += (float) $line->debit;
1319 1319
     }
1320 1320
 
1321 1321
     // Amount credit
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
         if (!$i) {
1328 1328
             $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit';
1329 1329
         }
1330
-        $totalarray['val']['totalcredit'] += (float)$line->credit;
1330
+        $totalarray['val']['totalcredit'] += (float) $line->credit;
1331 1331
     }
1332 1332
 
1333 1333
     // Amount balance
@@ -1436,13 +1436,13 @@  discard block
 block discarded – undo
1436 1436
 
1437 1437
 // Clean total values to round them
1438 1438
 if (!empty($totalarray['val']['totaldebit'])) {
1439
-    $totalarray['val']['totaldebit'] = (float)price2num($totalarray['val']['totaldebit'], 'MT');
1439
+    $totalarray['val']['totaldebit'] = (float) price2num($totalarray['val']['totaldebit'], 'MT');
1440 1440
 }
1441 1441
 if (!empty($totalarray['val']['totalcredit'])) {
1442
-    $totalarray['val']['totalcredit'] = (float)price2num($totalarray['val']['totalcredit'], 'MT');
1442
+    $totalarray['val']['totalcredit'] = (float) price2num($totalarray['val']['totalcredit'], 'MT');
1443 1443
 }
1444 1444
 if (!empty($totalarray['val']['totalbalance'])) {
1445
-    $totalarray['val']['totalbalance'] = (float)price2num($totalarray['val']['totaldebit'] - $totalarray['val']['totalcredit'], 'MT');
1445
+    $totalarray['val']['totalbalance'] = (float) price2num($totalarray['val']['totaldebit'] - $totalarray['val']['totalcredit'], 'MT');
1446 1446
 }
1447 1447
 
1448 1448
 // Show total line
Please login to merge, or discard this patch.