From 2745f986441023472858126a55698d2d15e18f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 5 Mar 2019 22:10:46 +0100 Subject: [PATCH] PSR2.Classes.PropertyDeclaration.VarUsed --- dev/setup/codesniffer/ruleset.xml | 1 + htdocs/comm/propal/class/propal.class.php | 88 +++++++++---------- htdocs/core/class/commonorder.class.php | 2 +- htdocs/core/class/stats.class.php | 6 +- .../modules/syslog/mod_syslog_chromephp.php | 6 +- .../core/modules/syslog/mod_syslog_file.php | 4 +- .../core/modules/syslog/mod_syslog_syslog.php | 2 +- .../class/expensereportstats.class.php | 10 +-- 8 files changed, 60 insertions(+), 59 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index b6f62aede64..d8fff2265e9 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -428,4 +428,5 @@ + diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 304eccf9bb7..ad5197512d4 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3526,13 +3526,13 @@ class Propal extends CommonObject if ($option == '') { $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params; } - if ($option == 'compta') { // deprecated + elseif ($option == 'compta') { // deprecated $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params; } - if ($option == 'expedition') { + elseif ($option == 'expedition') { $url = DOL_URL_ROOT.'/expedition/propal.php?id='.$this->id. $get_params; } - if ($option == 'document') { + elseif ($option == 'document') { $url = DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params; } @@ -3646,68 +3646,68 @@ class PropaleLigne extends CommonObjectLine */ public $table_element='propaldet'; - var $oldline; + public $oldline; // From llx_propaldet - var $fk_propal; - var $fk_parent_line; - var $desc; // Description ligne - var $fk_product; // Id produit predefini + public $fk_propal; + public $fk_parent_line; + public $desc; // Description ligne + public $fk_product; // Id produit predefini /** * @deprecated * @see product_type */ - var $fk_product_type; + public $fk_product_type; /** * Product type. * @var int * @see Product::TYPE_PRODUCT, Product::TYPE_SERVICE */ - var $product_type = Product::TYPE_PRODUCT; + public $product_type = Product::TYPE_PRODUCT; - var $qty; - var $tva_tx; - var $subprice; - var $remise_percent; - var $fk_remise_except; + public $qty; + public $tva_tx; + public $subprice; + public $remise_percent; + public $fk_remise_except; - var $rang = 0; + public $rang = 0; - var $fk_fournprice; - var $pa_ht; - var $marge_tx; - var $marque_tx; + public $fk_fournprice; + public $pa_ht; + public $marge_tx; + public $marque_tx; - var $special_code; // Tag for special lines (exlusive tags) + public $special_code; // Tag for special lines (exlusive tags) // 1: frais de port // 2: ecotaxe // 3: option line (when qty = 0) - var $info_bits = 0; // Liste d'options cumulables: + public $info_bits = 0; // Liste d'options cumulables: // Bit 0: 0 si TVA normal - 1 si TVA NPR // Bit 1: 0 ligne normale - 1 si ligne de remise fixe - var $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne - var $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne - var $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne + public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne + public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne + public $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne /** * @deprecated * @see $remise_percent, $fk_remise_except */ - var $remise; + public $remise; /** * @deprecated * @see subprice */ - var $price; + public $price; // From llx_product /** * @deprecated * @see product_ref */ - var $ref; + public $ref; /** * Product reference * @var string @@ -3717,7 +3717,7 @@ class PropaleLigne extends CommonObjectLine * @deprecated * @see product_label */ - var $libelle; + public $libelle; /** * Product label * @var string @@ -3729,25 +3729,25 @@ class PropaleLigne extends CommonObjectLine */ public $product_desc; - var $localtax1_tx; // Local tax 1 - var $localtax2_tx; // Local tax 2 - var $localtax1_type; // Local tax 1 type - var $localtax2_type; // Local tax 2 type - var $total_localtax1; // Line total local tax 1 - var $total_localtax2; // Line total local tax 2 + public $localtax1_tx; // Local tax 1 + public $localtax2_tx; // Local tax 2 + public $localtax1_type; // Local tax 1 type + public $localtax2_type; // Local tax 2 type + public $total_localtax1; // Line total local tax 1 + public $total_localtax2; // Line total local tax 2 - var $date_start; - var $date_end; + public $date_start; + public $date_end; - var $skip_update_total; // Skip update price total for special lines + public $skip_update_total; // Skip update price total for special lines // Multicurrency - var $fk_multicurrency; - var $multicurrency_code; - var $multicurrency_subprice; - var $multicurrency_total_ht; - var $multicurrency_total_tva; - var $multicurrency_total_ttc; + public $fk_multicurrency; + public $multicurrency_code; + public $multicurrency_subprice; + public $multicurrency_total_ht; + public $multicurrency_total_tva; + public $multicurrency_total_ttc; /** * Class line Contructor diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 9d9445df91c..ddaef527630 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -82,7 +82,7 @@ abstract class CommonOrderLine extends CommonObjectLine * @deprecated * @see subprice */ - var $price; + public $price; /** * Unit price before taxes diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index b35e9947644..b06f1deb4c3 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -29,9 +29,9 @@ */ abstract class Stats { - protected $db; - var $_lastfetchdate=array(); // Dates of cache file read by methods - var $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts) + protected $db; + private $_lastfetchdate=array(); // Dates of cache file read by methods + public $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts) /** * Return nb of elements by month for several years diff --git a/htdocs/core/modules/syslog/mod_syslog_chromephp.php b/htdocs/core/modules/syslog/mod_syslog_chromephp.php index 8ace164fce6..f3d34c4a9cd 100644 --- a/htdocs/core/modules/syslog/mod_syslog_chromephp.php +++ b/htdocs/core/modules/syslog/mod_syslog_chromephp.php @@ -7,7 +7,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; */ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface { - var $code = 'chromephp'; + public $code = 'chromephp'; /** * Return name of logger @@ -50,7 +50,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface return ($this->isActive() == 1)?'':$langs->trans('ClassNotFoundIntoPathWarning', 'ChromePhp.class.php'); } - + /** * Is the module active ? * @@ -159,7 +159,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface $res = @include_once 'ChromePhp.php'; if (! $res) $res=@include_once 'ChromePhp.class.php'; set_include_path($oldinclude); - + ob_start(); // To be sure headers are not flushed until all page is completely processed if ($content['level'] == LOG_ERR) ChromePhp::error($content['message']); elseif ($content['level'] == LOG_WARNING) ChromePhp::warn($content['message']); diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index ced2cf9133b..4c59eb5ef98 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -7,8 +7,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; */ class mod_syslog_file extends LogHandler implements LogHandlerInterface { - var $code = 'file'; - var $lastTime = 0; + public $code = 'file'; + public $lastTime = 0; /** * Return name of logger diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php index 26232e91ed5..97a37ff2c8a 100644 --- a/htdocs/core/modules/syslog/mod_syslog_syslog.php +++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php @@ -7,7 +7,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; */ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface { - var $code = 'syslog'; + public $code = 'syslog'; /** * Return name of logger diff --git a/htdocs/expensereport/class/expensereportstats.class.php b/htdocs/expensereport/class/expensereportstats.class.php index 082e3ce016e..5edf301ac25 100644 --- a/htdocs/expensereport/class/expensereportstats.class.php +++ b/htdocs/expensereport/class/expensereportstats.class.php @@ -35,12 +35,12 @@ class ExpenseReportStats extends Stats */ public $table_element; - var $socid; - var $userid; + public $socid; + public $userid; - var $from; - var $field; - var $where; + public $from; + public $field; + public $where; /** * Constructor