Passed
Push — GENERAL_BUG_REVIEW_240911 ( 6dbc7d...fb375d )
by Rafael
53:50
created
Dolibarr/Code/Salaries/Classes/PaymentSalary.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
     }
689 689
 
690 690
 
691
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
691
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
692 692
     /**
693 693
      *  Mise a jour du lien entre le paiement de  salaire et la ligne dans llx_bank generee
694 694
      *
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
      */
698 698
     public function update_fk_bank($id_bank)
699 699
     {
700
-		// phpcs:enable
700
+        // phpcs:enable
701 701
         $sql = "UPDATE " . MAIN_DB_PREFIX . "payment_salary SET fk_bank = " . ((int) $id_bank) . " WHERE rowid = " . ((int) $this->id);
702 702
 
703 703
         dol_syslog(get_class($this) . "::update_fk_bank", LOG_DEBUG);
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
         return $this->LibStatut($this->statut, $mode);
777 777
     }
778 778
 
779
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
779
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
780 780
     /**
781 781
      *  Return the status
782 782
      *
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
      */
787 787
     public function LibStatut($status, $mode = 0)
788 788
     {
789
-		// phpcs:enable
789
+        // phpcs:enable
790 790
         global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
791 791
 
792 792
         $langs->load('compta');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -294,7 +294,7 @@
 block discarded – undo
294 294
             $this->amount = $totalamount;
295 295
             $this->total = $totalamount; // deprecated
296 296
             $this->db->commit();
297
-            return $this->id;   // id of the last payment inserted
297
+            return $this->id; // id of the last payment inserted
298 298
         } else {
299 299
             $this->error = $this->db->error();
300 300
             $this->db->rollback();
Please login to merge, or discard this patch.
Dolibarr/Code/Salaries/Classes/Salary.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
         }
449 449
     }
450 450
 
451
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
451
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
452 452
     /**
453 453
      *  Update link between payment salary and line generate into llx_bank
454 454
      *
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
      */
458 458
     public function update_fk_bank($id_bank)
459 459
     {
460
-		// phpcs:enable
460
+        // phpcs:enable
461 461
         $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'salary SET fk_bank = ' . ((int) $id_bank);
462 462
         $sql .= " WHERE rowid = " . ((int) $this->id);
463 463
         $result = $this->db->query($sql);
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         }
666 666
     }
667 667
 
668
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
668
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
669 669
     /**
670 670
      *    Tag social contribution as paid completely
671 671
      *
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
      */
677 677
     public function set_paid($user)
678 678
     {
679
-		// phpcs:enable
679
+        // phpcs:enable
680 680
         dol_syslog(get_class($this) . "::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
681 681
         return $this->setPaid($user);
682 682
     }
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
         }
704 704
     }
705 705
 
706
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
706
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
707 707
     /**
708 708
      *    Remove tag paid on social contribution
709 709
      *
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
      */
713 713
     public function set_unpaid($user)
714 714
     {
715
-		// phpcs:enable
715
+        // phpcs:enable
716 716
         $sql = "UPDATE " . MAIN_DB_PREFIX . "salary SET";
717 717
         $sql .= " paye = 0";
718 718
         $sql .= " WHERE rowid = " . ((int) $this->id);
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
         return $this->LibStatut($this->paye, $mode, $alreadypaid);
741 741
     }
742 742
 
743
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
743
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
744 744
     /**
745 745
      *  Return label of a given status
746 746
      *
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
      */
752 752
     public function LibStatut($status, $mode = 0, $alreadypaid = -1)
753 753
     {
754
-		// phpcs:enable
754
+        // phpcs:enable
755 755
         global $langs;
756 756
 
757 757
         // Load translation files required by the page
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
         return $return;
835 835
     }
836 836
 
837
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
837
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
838 838
     /**
839 839
      *  Create a withdrawal request for a direct debit order or a credit transfer order.
840 840
      *  Use the remain to pay excluding all existing open direct debit requests.
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
      */
849 849
     public function demande_prelevement($fuser, $amount = 0, $type = 'direct-debit', $sourcetype = 'salaire', $checkduplicateamongall = 0)
850 850
     {
851
-		// phpcs:enable
851
+        // phpcs:enable
852 852
         global $conf, $mysoc;
853 853
 
854 854
         $error = 0;
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
         }
957 957
     }
958 958
 
959
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
959
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
960 960
     /**
961 961
      *  Remove a direct debit request or a credit transfer request
962 962
      *
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
      */
967 967
     public function demande_prelevement_delete($fuser, $did)
968 968
     {
969
-		// phpcs:enable
969
+        // phpcs:enable
970 970
         $sql = 'DELETE FROM ' . $this->db->prefix() . 'prelevement_demande';
971 971
         $sql .= ' WHERE rowid = ' . ((int) $did);
972 972
         $sql .= ' AND traite = 0';
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -619,7 +619,7 @@
 block discarded – undo
619 619
                 } elseif ($multicurrency) {
620 620
                     //$this->sumpayed_multicurrency = $obj->multicurrency_amount;
621 621
                     //return (float) $obj->multicurrency_amount;
622
-                    return -1;      // Not yet supported
622
+                    return -1; // Not yet supported
623 623
                 } else {
624 624
                     //$this->sumpayed = $obj->amount;
625 625
                     return (float) $obj->amount;
Please login to merge, or discard this patch.
Dolibarr/Code/Salaries/Api/Salaries.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
         return $paymentsalary;
456 456
     }
457 457
 
458
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
458
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
459 459
     /**
460 460
      * Clean sensible object datas
461 461
      *
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
      */
465 465
     protected function _cleanObjectDatas($object)
466 466
     {
467
-		// phpcs:enable
467
+        // phpcs:enable
468 468
         $object = parent::_cleanObjectDatas($object);
469 469
 
470 470
         unset($object->rowid);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -445,7 +445,9 @@
 block discarded – undo
445 445
     {
446 446
         $paymentsalary = array();
447 447
         $fields = Salaries::$FIELDSPAYMENT;
448
-        if (isModEnabled("bank")) array_push($fields, "accountid");
448
+        if (isModEnabled("bank")) {
449
+            array_push($fields, "accountid");
450
+        }
449 451
         foreach ($fields as $field) {
450 452
             if (!isset($data[$field])) {
451 453
                 throw new RestException(400, "$field field missing");
Please login to merge, or discard this patch.
Dolibarr/Code/Zapier/Classes/Hook.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         $sql .= ' t.rowid';
404 404
         // TODO Get all fields
405 405
         $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
406
-        $sql .= ' WHERE t.entity = ' . ((int)$conf->entity);
406
+        $sql .= ' WHERE t.entity = ' . ((int) $conf->entity);
407 407
 
408 408
         // Manage filter
409 409
         $errormessage = '';
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
         $sql = 'SELECT rowid, date_creation as datec, tms as datem,';
612 612
         $sql .= ' fk_user_creat, fk_user_modif';
613 613
         $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
614
-        $sql .= ' WHERE t.rowid = ' . ((int)$id);
614
+        $sql .= ' WHERE t.rowid = ' . ((int) $id);
615 615
         $result = $this->db->query($sql);
616 616
         if ($result) {
617 617
             if ($this->db->num_rows($result)) {
Please login to merge, or discard this patch.
Dolibarr/Code/Zapier/Api/Zapier.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         );
296 296
     }
297 297
 
298
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
298
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
299 299
     /**
300 300
      * Clean sensible object datas
301 301
      *
@@ -304,30 +304,30 @@  discard block
 block discarded – undo
304 304
      */
305 305
     public function _cleanObjectDatas($object)
306 306
     {
307
-		// phpcs:disable
308
-		$object = parent::_cleanObjectDatas($object);
309
-
310
-		return $object;
311
-	}
312
-
313
-	/**
314
-	 * Validate fields before create or update object
315
-	 *
316
-	 * @param   array       $data       Array of data to validate
317
-	 * @param   array       $fields     Array of fields needed
318
-	 * @return  array
319
-	 *
320
-	 * @throws  RestException
321
-	 */
322
-	private function validate($data, $fields)
323
-	{
324
-		$hook = array();
325
-		foreach ($fields as $field) {
326
-			if (!isset($data[$field])) {
327
-				throw new RestException(400, $field." field missing");
328
-			}
329
-			$hook[$field] = $data[$field];
330
-		}
331
-		return $hook;
332
-	}
307
+        // phpcs:disable
308
+        $object = parent::_cleanObjectDatas($object);
309
+
310
+        return $object;
311
+    }
312
+
313
+    /**
314
+     * Validate fields before create or update object
315
+     *
316
+     * @param   array       $data       Array of data to validate
317
+     * @param   array       $fields     Array of fields needed
318
+     * @return  array
319
+     *
320
+     * @throws  RestException
321
+     */
322
+    private function validate($data, $fields)
323
+    {
324
+        $hook = array();
325
+        foreach ($fields as $field) {
326
+            if (!isset($data[$field])) {
327
+                throw new RestException(400, $field." field missing");
328
+            }
329
+            $hook[$field] = $data[$field];
330
+        }
331
+        return $hook;
332
+    }
333 333
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -324,7 +324,7 @@
 block discarded – undo
324 324
 		$hook = array();
325 325
 		foreach ($fields as $field) {
326 326
 			if (!isset($data[$field])) {
327
-				throw new RestException(400, $field." field missing");
327
+				throw new RestException(400, $field . " field missing");
328 328
 			}
329 329
 			$hook[$field] = $data[$field];
330 330
 		}
Please login to merge, or discard this patch.
Dolibarr/Code/Recruitement/Classes/RecruitmentJobPosition.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
         return $this->LibStatut($this->status, $mode);
894 894
     }
895 895
 
896
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
896
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
897 897
     /**
898 898
      *  Return the status
899 899
      *
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
      */
904 904
     public function LibStatut($status, $mode = 0)
905 905
     {
906
-		// phpcs:enable
906
+        // phpcs:enable
907 907
         if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
908 908
             global $langs;
909 909
             //$langs->load("recruitment");
Please login to merge, or discard this patch.
Dolibarr/Code/Recruitement/Classes/RecruitmentCandidature.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
         return $this->LibStatut($this->status, $mode);
817 817
     }
818 818
 
819
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
819
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
820 820
     /**
821 821
      *  Return the status
822 822
      *
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
      */
827 827
     public function LibStatut($status, $mode = 0)
828 828
     {
829
-		// phpcs:enable
829
+        // phpcs:enable
830 830
         if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
831 831
             global $langs;
832 832
             //$langs->load("recruitment@recruitment");
Please login to merge, or discard this patch.
Dolibarr/Code/Recruitement/Api/Recruitments.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -347,15 +347,15 @@  discard block
 block discarded – undo
347 347
     }
348 348
 
349 349
     /**
350
-    * Create candidature object
351
-    *
352
-    * @param array $request_data   Request datas
353
-    * @return int  ID of candidature
354
-    *
355
-    * @throws RestException
356
-    *
357
-    * @url  POST candidature/
358
-    */
350
+     * Create candidature object
351
+     *
352
+     * @param array $request_data   Request datas
353
+     * @return int  ID of candidature
354
+     *
355
+     * @throws RestException
356
+     *
357
+     * @url  POST candidature/
358
+     */
359 359
     public function postCandidature($request_data = null)
360 360
     {
361 361
         if (!DolibarrApiAccess::$user->hasRight('recruitment', 'recruitmentjobposition', 'write')) {
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
     }
557 557
 
558 558
 
559
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
559
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
560 560
     /**
561 561
      * Clean sensible object datas
562 562
      *
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
      */
566 566
     protected function _cleanObjectDatas($object)
567 567
     {
568
-		// phpcs:enable
568
+        // phpcs:enable
569 569
         $object = parent::_cleanObjectDatas($object);
570 570
 
571 571
         unset($object->rowid);
Please login to merge, or discard this patch.
Dolibarr/Code/Resource/Classes/FormResource.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     }
66 66
 
67 67
 
68
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
68
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
69 69
     /**
70 70
      *  Output html form to select a resource
71 71
      *
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function select_resource_list($selected = 0, $htmlname = 'fk_resource', array $filter = [], $showempty = 0, $showtype = 0, $forcecombo = 0, $event = [], $filterkey = [], $outputmode = 0, $limit = 20, $morecss = 'minwidth100', $multiple = false)
87 87
     {
88
-		// phpcs:enable
88
+        // phpcs:enable
89 89
         global $conf, $langs;
90 90
 
91 91
         $out = '';
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         return $out;
167 167
     }
168 168
 
169
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
169
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
170 170
     /**
171 171
      *  Return html list of tickets type
172 172
      *
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
      */
182 182
     public function select_types_resource($selected = '', $htmlname = 'type_resource', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0)
183 183
     {
184
-		// phpcs:enable
184
+        // phpcs:enable
185 185
         global $langs, $user;
186 186
 
187 187
         $resourcestat = new Dolresource($this->db);
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         }
245 245
     }
246 246
 
247
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
247
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
248 248
     /**
249 249
      *    Return a select list with zip codes and their town
250 250
      *
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
      */
260 260
     public function select_ziptown($selected = '', $htmlname = 'zipcode', $fields = array(), $fieldsize = 0, $disableautocomplete = 0, $moreattrib = '', $morecss = '')
261 261
     {
262
-		// phpcs:enable
262
+        // phpcs:enable
263 263
         global $conf;
264 264
 
265 265
         $out = '';
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         return $out;
279 279
     }
280 280
 
281
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
281
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
282 282
     /**
283 283
      *   Returns the drop-down list of departments/provinces/cantons for all countries or for a given country.
284 284
      *   In the case of an all-country list, the display breaks on the country.
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      */
295 295
     public function select_state($selected = 0, $country_codeid = 0, $htmlname = 'state_id', $morecss = 'maxwidth200onsmartphone  minwidth300')
296 296
     {
297
-		// phpcs:enable
297
+        // phpcs:enable
298 298
         global $conf, $langs, $user;
299 299
 
300 300
         dol_syslog(get_class($this) . "::select_departement selected=" . $selected . ", country_codeid=" . $country_codeid, LOG_DEBUG);
Please login to merge, or discard this patch.