diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-03-28 03:42:39 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-03-28 03:42:40 +0400 |
commit | ae4b03163792f0b6e933933e5d37df87dc3fd566 (patch) | |
tree | d1d7510a9728f587d3d63ebd03e4ecf3d904838b /core/DataTable/Filter/RangeCheck.php | |
parent | 158c2150f5f2e13ece459b8d131244c11b763997 (diff) |
Mass conversion of all files to the newly agreed coding standard: PSR 1/2
Converting Piwik core source files, PHP, JS, TPL, CSS
More info: http://piwik.org/participate/coding-standards/
Diffstat (limited to 'core/DataTable/Filter/RangeCheck.php')
-rw-r--r-- | core/DataTable/Filter/RangeCheck.php | 79 |
1 files changed, 37 insertions, 42 deletions
diff --git a/core/DataTable/Filter/RangeCheck.php b/core/DataTable/Filter/RangeCheck.php index 105f22f395..ebfea03d7f 100644 --- a/core/DataTable/Filter/RangeCheck.php +++ b/core/DataTable/Filter/RangeCheck.php @@ -1,10 +1,10 @@ <?php /** * Piwik - Open source web analytics - * + * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - * + * * @category Piwik * @package Piwik */ @@ -17,48 +17,43 @@ */ class Piwik_DataTable_Filter_RangeCheck extends Piwik_DataTable_Filter { - static public $minimumValue = 0.00; - static public $maximumValue = 100.0; + static public $minimumValue = 0.00; + static public $maximumValue = 100.0; - /** - * @param Piwik_DataTable $table - * @param string $columnToFilter name of the column to filter - * @param float $minimumValue minimum value for range - * @param float $maximumValue maximum value for range - */ - public function __construct( $table, $columnToFilter, $minimumValue = 0.00, $maximumValue = 100.0 ) - { - parent::__construct($table); + /** + * @param Piwik_DataTable $table + * @param string $columnToFilter name of the column to filter + * @param float $minimumValue minimum value for range + * @param float $maximumValue maximum value for range + */ + public function __construct($table, $columnToFilter, $minimumValue = 0.00, $maximumValue = 100.0) + { + parent::__construct($table); - $this->columnToFilter = $columnToFilter; + $this->columnToFilter = $columnToFilter; - if ($minimumValue < $maximumValue) { - self::$minimumValue = $minimumValue; - self::$maximumValue = $maximumValue; - } - } + if ($minimumValue < $maximumValue) { + self::$minimumValue = $minimumValue; + self::$maximumValue = $maximumValue; + } + } - /** - * Executes the filter an adjusts all columns to fit the defined range - * - * @param Piwik_DataTable $table - */ - public function filter($table) - { - foreach($table->getRows() as $row) - { - $value = $row->getColumn($this->columnToFilter); - if($value !== false) - { - if ($value < self::$minimumValue) - { - $row->setColumn($this->columnToFilter, self::$minimumValue); - } - elseif ($value > self::$maximumValue) - { - $row->setColumn($this->columnToFilter, self::$maximumValue); - } - } - } - } + /** + * Executes the filter an adjusts all columns to fit the defined range + * + * @param Piwik_DataTable $table + */ + public function filter($table) + { + foreach ($table->getRows() as $row) { + $value = $row->getColumn($this->columnToFilter); + if ($value !== false) { + if ($value < self::$minimumValue) { + $row->setColumn($this->columnToFilter, self::$minimumValue); + } elseif ($value > self::$maximumValue) { + $row->setColumn($this->columnToFilter, self::$maximumValue); + } + } + } + } } |