From e9a2894727f755175cfddf965399dbe49f3c040e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Apr 2018 20:57:43 +0200 Subject: [PATCH] Fix PSR2 --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/lib/files.lib.php | 4 ++-- htdocs/fourn/commande/card.php | 4 ++-- scripts/accountancy/export-thirdpartyaccount.php | 10 +++------- test/phpunit/WebservicesInvoicesTest.php | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7a067e7d16d..84c25573e85 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6605,7 +6605,7 @@ abstract class CommonObject { if(empty($this->{$field})) { - $queryarray[$field] = NULL; + $queryarray[$field] = null; } else { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index bd3b570799c..3d3f38eca2c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1139,7 +1139,7 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n if (preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file)) { dol_syslog("Refused to delete file ".$file, LOG_WARNING); - return False; + return false; } if (empty($nohook)) @@ -1238,7 +1238,7 @@ function dol_delete_dir($dir,$nophperrors=0) if (preg_match('/\.\./',$dir) || preg_match('/[<>|]/',$dir)) { dol_syslog("Refused to delete dir ".$dir, LOG_WARNING); - return False; + return false; } $dir_osencoded=dol_osencode($dir); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index cec2b306c4e..033cf251d4e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2660,7 +2660,7 @@ elseif (! empty($object->id)) // Ensure that price is equal and warn user if it's not $supplier_price = price($result_product["product"]["price_net"]); //Price of client tab in supplier dolibarr - $local_price = NULL; //Price of supplier as stated in product suppliers tab on this dolibarr, NULL if not found + $local_price = null; //Price of supplier as stated in product suppliers tab on this dolibarr, NULL if not found $product_fourn = new ProductFournisseur($db); $product_fourn_list = $product_fourn->list_product_fournisseur_price($line->fk_product); @@ -2675,7 +2675,7 @@ elseif (! empty($object->id)) } } - if ($local_price != NULL && $local_price != $supplier_price) { + if ($local_price != null && $local_price != $supplier_price) { setEventMessages($line_id.$langs->trans("RemotePriceMismatch")." ".$supplier_price." - ".$local_price, null, 'warnings'); } diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php index e5ba6bad702..2d557768d7d 100755 --- a/scripts/accountancy/export-thirdpartyaccount.php +++ b/scripts/accountancy/export-thirdpartyaccount.php @@ -201,13 +201,9 @@ if ($resql) { print '' . $langs->trans("Phone") . ''; print '' . $langs->trans("Fax") . ''; - $var = True; - - while ( $obj = $db->fetch_object($resql) ) { - - $var = ! $var; - - print ''; + while ($obj = $db->fetch_object($resql)) + { + print ''; print ''; $thirdpartystatic->id = $obj->rowid; $thirdpartystatic->name = $obj->name; diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index d2d02bde974..fe896894d86 100644 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -291,7 +291,7 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase // Test URL $result=''; - $parameters = array('authentication'=>$authentication,'id'=>NULL,'ref'=>NULL,'ref_ext'=>'ref-phpunit-2'); + $parameters = array('authentication'=>$authentication, 'id'=>null, 'ref'=>null, 'ref_ext'=>'ref-phpunit-2'); print __METHOD__." call method ".$WS_METHOD."\n"; try { $result = $this->soapclient->call($WS_METHOD,$parameters,$this->ns,'');