Passed
Push — EXTRACT_CLASSES ( 231cec )
by Rafael
70:48
created
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.
public/htdocs/don/class/paymentdonation.class.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     public $amounts = array(); // Array of amounts
66 66
 
67 67
     public $fk_typepayment; // Payment mode ID
68
-    public $paymenttype;    // Payment mode ID or Code. TODO Use only the code in this field.
68
+    public $paymenttype; // Payment mode ID or Code. TODO Use only the code in this field.
69 69
 
70 70
     /**
71 71
      * @var string      Payment reference
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         // Clean parameters
137 137
 
138 138
         if (isset($this->fk_donation)) {
139
-            $this->fk_donation = (int)$this->fk_donation;
139
+            $this->fk_donation = (int) $this->fk_donation;
140 140
         }
141 141
         if (isset($this->amount)) {
142 142
             $this->amount = trim($this->amount);
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
             $this->note_public = trim($this->note_public);
152 152
         }
153 153
         if (isset($this->fk_bank)) {
154
-            $this->fk_bank = (int)$this->fk_bank;
154
+            $this->fk_bank = (int) $this->fk_bank;
155 155
         }
156 156
         if (isset($this->fk_user_creat)) {
157
-            $this->fk_user_creat = (int)$this->fk_user_creat;
157
+            $this->fk_user_creat = (int) $this->fk_user_creat;
158 158
         }
159 159
         if (isset($this->fk_user_modif)) {
160
-            $this->fk_user_modif = (int)$this->fk_user_modif;
160
+            $this->fk_user_modif = (int) $this->fk_user_modif;
161 161
         }
162 162
 
163 163
         // Check parameters
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         $sql .= " fk_bank=" . (isset($this->fk_bank) ? $this->fk_bank : "null") . ",";
177 177
         $sql .= " fk_user_creat=" . (isset($this->fk_user_creat) ? $this->fk_user_creat : "null") . ",";
178 178
         $sql .= " fk_user_modif=" . (isset($this->fk_user_modif) ? $this->fk_user_modif : "null");
179
-        $sql .= " WHERE rowid=" . (int)$this->id;
179
+        $sql .= " WHERE rowid=" . (int) $this->id;
180 180
 
181 181
         $this->db->begin();
182 182
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 
231 231
         if (!$error) {
232 232
             $sql = "DELETE FROM " . MAIN_DB_PREFIX . "bank_url";
233
-            $sql .= " WHERE type='payment_donation' AND url_id=" . (int)$this->id;
233
+            $sql .= " WHERE type='payment_donation' AND url_id=" . (int) $this->id;
234 234
 
235 235
             dol_syslog(get_class($this) . "::delete", LOG_DEBUG);
236 236
             $resql = $this->db->query($sql);
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
         if (!$error) {
244 244
             $sql = "DELETE FROM " . MAIN_DB_PREFIX . "payment_donation";
245
-            $sql .= " WHERE rowid=" . ((int)$this->id);
245
+            $sql .= " WHERE rowid=" . ((int) $this->id);
246 246
 
247 247
             dol_syslog(get_class($this) . "::delete", LOG_DEBUG);
248 248
             $resql = $this->db->query($sql);
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         $sql .= " FROM " . MAIN_DB_PREFIX . "payment_donation as t";
355 355
         $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_paiement as pt ON t.fk_typepayment = pt.id";
356 356
         $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON t.fk_bank = b.rowid';
357
-        $sql .= " WHERE t.rowid = " . ((int)$id);
357
+        $sql .= " WHERE t.rowid = " . ((int) $id);
358 358
 
359 359
         dol_syslog(get_class($this) . "::fetch", LOG_DEBUG);
360 360
         $resql = $this->db->query($sql);
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
                 $this->tms = $this->db->jdate($obj->tms);
371 371
                 $this->datep = $this->db->jdate($obj->datep);
372 372
                 $this->amount = $obj->amount;
373
-                $this->fk_typepayment = $obj->fk_typepayment;   // Id on type of payent
374
-                $this->paymenttype = $obj->fk_typepayment;   // Id on type of payment. We should store the code into paymenttype.
373
+                $this->fk_typepayment = $obj->fk_typepayment; // Id on type of payent
374
+                $this->paymenttype = $obj->fk_typepayment; // Id on type of payment. We should store the code into paymenttype.
375 375
                 $this->num_payment = $obj->num_payment;
376 376
                 $this->note_public = $obj->note_public;
377 377
                 $this->fk_bank = $obj->fk_bank;
@@ -415,14 +415,14 @@  discard block
 block discarded – undo
415 415
 
416 416
         // Clean parameters
417 417
         if (isset($this->chid)) {
418
-            $this->chid = (int)$this->chid;
418
+            $this->chid = (int) $this->chid;
419 419
         } elseif (isset($this->fk_donation)) {
420 420
             // NOTE : The property used in INSERT for fk_donation is not fk_donation but chid
421 421
             //        (keep priority to chid property)
422
-            $this->chid = (int)$this->fk_donation;
422
+            $this->chid = (int) $this->fk_donation;
423 423
         }
424 424
         if (isset($this->fk_donation)) {
425
-            $this->fk_donation = (int)$this->fk_donation;
425
+            $this->fk_donation = (int) $this->fk_donation;
426 426
         }
427 427
         if (isset($this->amount)) {
428 428
             $this->amount = trim($this->amount);
@@ -437,13 +437,13 @@  discard block
 block discarded – undo
437 437
             $this->note_public = trim($this->note_public);
438 438
         }
439 439
         if (isset($this->fk_bank)) {
440
-            $this->fk_bank = (int)$this->fk_bank;
440
+            $this->fk_bank = (int) $this->fk_bank;
441 441
         }
442 442
         if (isset($this->fk_user_creat)) {
443
-            $this->fk_user_creat = (int)$this->fk_user_creat;
443
+            $this->fk_user_creat = (int) $this->fk_user_creat;
444 444
         }
445 445
         if (isset($this->fk_user_modif)) {
446
-            $this->fk_user_modif = (int)$this->fk_user_modif;
446
+            $this->fk_user_modif = (int) $this->fk_user_modif;
447 447
         }
448 448
 
449 449
         $totalamount = 0;
@@ -466,18 +466,18 @@  discard block
 block discarded – undo
466 466
             $sql = "INSERT INTO " . MAIN_DB_PREFIX . "payment_donation (fk_donation, datec, datep, amount,";
467 467
             $sql .= " fk_typepayment, num_payment, note, ext_payment_id, ext_payment_site,";
468 468
             $sql .= " fk_user_creat, fk_bank)";
469
-            $sql .= " VALUES (" . ((int)$this->chid) . ", '" . $this->db->idate($now) . "',";
469
+            $sql .= " VALUES (" . ((int) $this->chid) . ", '" . $this->db->idate($now) . "',";
470 470
             $sql .= " '" . $this->db->idate($this->datep) . "',";
471
-            $sql .= " " . ((float)price2num($totalamount)) . ",";
472
-            $sql .= " " . ((int)$this->paymenttype) . ", '" . $this->db->escape($this->num_payment) . "', '" . $this->db->escape($this->note_public) . "', ";
471
+            $sql .= " " . ((float) price2num($totalamount)) . ",";
472
+            $sql .= " " . ((int) $this->paymenttype) . ", '" . $this->db->escape($this->num_payment) . "', '" . $this->db->escape($this->note_public) . "', ";
473 473
             $sql .= " " . ($this->ext_payment_id ? "'" . $this->db->escape($this->ext_payment_id) . "'" : "null") . ", " . ($this->ext_payment_site ? "'" . $this->db->escape($this->ext_payment_site) . "'" : "null") . ",";
474
-            $sql .= " " . ((int)$user->id) . ", 0)";
474
+            $sql .= " " . ((int) $user->id) . ", 0)";
475 475
 
476 476
             dol_syslog(get_class($this) . "::create", LOG_DEBUG);
477 477
             $resql = $this->db->query($sql);
478 478
             if ($resql) {
479 479
                 $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "payment_donation");
480
-                $this->ref = (string)$this->id;
480
+                $this->ref = (string) $this->id;
481 481
             } else {
482 482
                 $error++;
483 483
             }
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
     public function update_fk_bank($id_bank)
649 649
     {
650 650
         // phpcs:enable
651
-        $sql = "UPDATE " . MAIN_DB_PREFIX . "payment_donation SET fk_bank = " . (int)$id_bank . " WHERE rowid = " . (int)$this->id;
651
+        $sql = "UPDATE " . MAIN_DB_PREFIX . "payment_donation SET fk_bank = " . (int) $id_bank . " WHERE rowid = " . (int) $this->id;
652 652
 
653 653
         dol_syslog(get_class($this) . "::update_fk_bank", LOG_DEBUG);
654 654
         $result = $this->db->query($sql);
Please login to merge, or discard this patch.