From 1b02890a2f360de4df4136d1a6d3ae5e9767c164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Santos?= Date: Wed, 15 Jul 2015 11:05:54 +0100 Subject: [PATCH 1/3] Fix helpers with static methods --- com_ccex/site/helpers/cast.php | 2 +- com_ccex/site/helpers/style.php | 2 +- com_ccex/site/helpers/tag.php | 8 ++++---- com_ccex/site/helpers/view.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/com_ccex/site/helpers/cast.php b/com_ccex/site/helpers/cast.php index 9e8c447..a5b671b 100644 --- a/com_ccex/site/helpers/cast.php +++ b/com_ccex/site/helpers/cast.php @@ -13,7 +13,7 @@ class CCExHelpersCast * @param object $sourceObject * @return object */ - function cast($destination, $sourceObject) { + static function cast($destination, $sourceObject) { if (is_string($destination)) { $destination = new $destination(); } diff --git a/com_ccex/site/helpers/style.php b/com_ccex/site/helpers/style.php index 4301677..72b404d 100644 --- a/com_ccex/site/helpers/style.php +++ b/com_ccex/site/helpers/style.php @@ -5,7 +5,7 @@ class CCExHelpersStyle { - function load() { + static function load() { $document = JFactory::getDocument(); //javascripts diff --git a/com_ccex/site/helpers/tag.php b/com_ccex/site/helpers/tag.php index b2f2594..70a2c12 100644 --- a/com_ccex/site/helpers/tag.php +++ b/com_ccex/site/helpers/tag.php @@ -5,7 +5,7 @@ class CCExHelpersTag { - function formatCurrency($value) { + static function formatCurrency($value) { if ($value < 0.01 || $value > 99999999) { return sprintf('%.2e', $value); } else if (is_float($value)) { @@ -15,15 +15,15 @@ function formatCurrency($value) { } } - function formatCurrencyWithSymbol($value, $symbol) { + static function formatCurrencyWithSymbol($value, $symbol) { return sprintf('%s%s', $symbol, CCExHelpersTag::formatCurrency($value)); } - function formatWithSymbol($value, $symbol) { + static function formatWithSymbol($value, $symbol) { return sprintf('%s%s', $symbol, $value); } - function formatBoolean($boolean) { + static function formatBoolean($boolean) { if ($boolean) { return "Yes"; } else { diff --git a/com_ccex/site/helpers/view.php b/com_ccex/site/helpers/view.php index ce533da..0bf7a96 100644 --- a/com_ccex/site/helpers/view.php +++ b/com_ccex/site/helpers/view.php @@ -5,7 +5,7 @@ class CCExHelpersView { - function load($viewName, $layoutName = 'default', $viewFormat = 'html', $vars = null) { + static function load($viewName, $layoutName = 'default', $viewFormat = 'html', $vars = null) { // Get the application $app = JFactory::getApplication(); @@ -36,7 +36,7 @@ function load($viewName, $layoutName = 'default', $viewFormat = 'html', $vars = return $view; } - function getHtml($view, $layout, $item, $data) { + static function getHtml($view, $layout, $item, $data) { $objectView = CCExHelpersView::load($view, $layout, 'phtml'); $objectView->$item = $data; From bd0e2b1d0f58a22c9ec8aac79d6419dd349321b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Santos?= Date: Wed, 15 Jul 2015 11:24:12 +0100 Subject: [PATCH 2/3] Fix: Only variables should be passed by reference --- com_ccex/site/models/collection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com_ccex/site/models/collection.php b/com_ccex/site/models/collection.php index 5252649..495d941 100644 --- a/com_ccex/site/models/collection.php +++ b/com_ccex/site/models/collection.php @@ -229,7 +229,8 @@ public function intervalsWithoutLast() { } public function lastInterval() { - return CCExHelpersCast::cast('CCExModelsInterval', end($this->intervals())); + $intervals = $this->intervals(); + return CCExHelpersCast::cast('CCExModelsInterval', end($intervals)); } public function newInterval() { From 27c06bb20cda30ae88a1f959083e1b52aea50d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Santos?= Date: Wed, 15 Jul 2015 11:53:04 +0100 Subject: [PATCH 3/3] Hide warnings: strict standards --- com_ccex/site/ccex.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com_ccex/site/ccex.php b/com_ccex/site/ccex.php index 3136e97..3120ddc 100644 --- a/com_ccex/site/ccex.php +++ b/com_ccex/site/ccex.php @@ -2,7 +2,7 @@ // No direct access ini_set('display_errors', true); -error_reporting(E_ALL); +error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); defined('_JEXEC') or die('Restricted access'); //sessions