From 5e63642fcbb607a424a8daa7681bf7a607c87e97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Aug 2012 17:55:15 +0200 Subject: [PATCH 1/3] Change to ignore bad detection of ident by PEAR code sniffer. --- dev/codesniffer/jenkins_ruleset.xml | 4 ++++ dev/codesniffer/ruleset.xml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/dev/codesniffer/jenkins_ruleset.xml b/dev/codesniffer/jenkins_ruleset.xml index 48a8c363e5e..4e4b35e445b 100755 --- a/dev/codesniffer/jenkins_ruleset.xml +++ b/dev/codesniffer/jenkins_ruleset.xml @@ -200,6 +200,10 @@ + + 0 + + diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 8d2bf842066..b6462e166f4 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -200,6 +200,10 @@ + + 0 + + From 8a42cc26b7d719113051da06d8c2e1530db9e1e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Aug 2012 18:00:59 +0200 Subject: [PATCH 2/3] Fix: Bad syntax of class name --- htdocs/compta/localtax/class/localtax.class.php | 5 ++--- htdocs/compta/localtax/fiche.php | 8 ++++---- htdocs/compta/localtax/reglement.php | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 6f0c46b813b..3ad10ec2d08 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -25,10 +25,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; /** - * \class Localtax - * \brief Put here description of your class + * Class to manage local tax */ -class localtax extends CommonObject +class Localtax extends CommonObject { var $id; var $ref; diff --git a/htdocs/compta/localtax/fiche.php b/htdocs/compta/localtax/fiche.php index aa27f201a26..4d761366e9d 100644 --- a/htdocs/compta/localtax/fiche.php +++ b/htdocs/compta/localtax/fiche.php @@ -40,13 +40,13 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); /* - * Actions + * Actions */ //add payment of localtax if ($_POST["action"] == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) { - $localtax = new localtax($db); + $localtax = new Localtax($db); $db->begin(); @@ -78,7 +78,7 @@ if ($_POST["action"] == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) //delete payment of localtax if ($_GET["action"] == 'delete') { - $localtax = new localtax($db); + $localtax = new Localtax($db); $result=$localtax->fetch($_GET['id']); if ($localtax->rappro == 0) @@ -131,7 +131,7 @@ $form = new Form($db); if ($id) { - $vatpayment = new localtax($db); + $vatpayment = new Localtax($db); $result = $vatpayment->fetch($id); if ($result <= 0) { diff --git a/htdocs/compta/localtax/reglement.php b/htdocs/compta/localtax/reglement.php index 6d4bf4de6dc..104890184ab 100644 --- a/htdocs/compta/localtax/reglement.php +++ b/htdocs/compta/localtax/reglement.php @@ -38,7 +38,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); llxHeader(); -$localtax_static = new localtax($db); +$localtax_static = new Localtax($db); print_fiche_titre($langs->transcountry("LT2Payments",$mysoc->country_code)); From 29fa8b64c4c43e09df81a23a985839c80746501b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Aug 2012 18:04:00 +0200 Subject: [PATCH 3/3] Checkstyle --- htdocs/core/class/rssparser.class.php | 76 ++++++++++++++++----------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index f86c40b0879..e2290b0699e 100755 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,11 @@ /** * \file htdocs/core/class/rssparser.class.php * \ingroup core - * \brief File of class to parse rss feeds + * \brief File of class to parse RSS feeds + */ + +/** + * Class to parse RSS files */ class RssParser { @@ -38,20 +42,38 @@ class RssParser private $_lastfetchdate; // Last successful fetch private $_rssarray=array(); + // For parsing with xmlparser + var $stack = array(); // parser stack + var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright'); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db=$db; + } + /** * getFormat * * @return string */ - public function getFormat() { + public function getFormat() + { return $this->_format; } + /** * getUrlRss * * @return string */ - public function getUrlRss() { + public function getUrlRss() + { return $this->_urlRSS; } /** @@ -59,7 +81,8 @@ class RssParser * * @return string */ - public function getLanguage() { + public function getLanguage() + { return $this->_language; } /** @@ -67,7 +90,8 @@ class RssParser * * @return string */ - public function getGenerator() { + public function getGenerator() + { return $this->_generator; } /** @@ -75,7 +99,8 @@ class RssParser * * @return string */ - public function getCopyright() { + public function getCopyright() + { return $this->_copyright; } /** @@ -83,7 +108,8 @@ class RssParser * * @return string */ - public function getLastBuildDate() { + public function getLastBuildDate() + { return $this->_lastbuilddate; } /** @@ -91,7 +117,8 @@ class RssParser * * @return string */ - public function getImageUrl() { + public function getImageUrl() + { return $this->_imageurl; } /** @@ -99,7 +126,8 @@ class RssParser * * @return string */ - public function getLink() { + public function getLink() + { return $this->_link; } /** @@ -107,7 +135,8 @@ class RssParser * * @return string */ - public function getTitle() { + public function getTitle() + { return $this->_title; } /** @@ -115,7 +144,8 @@ class RssParser * * @return string */ - public function getDescription() { + public function getDescription() + { return $this->_description; } /** @@ -123,7 +153,8 @@ class RssParser * * @return string */ - public function getLastFetchDate() { + public function getLastFetchDate() + { return $this->_lastfetchdate; } /** @@ -131,24 +162,9 @@ class RssParser * * @return string */ - public function getItems() { - return $this->_rssarray; - } - - - // For parsing with xmlparser - var $stack = array(); // parser stack - var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright'); - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct($db) + public function getItems() { - $this->db=$db; + return $this->_rssarray; }