diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-10-08 09:24:28 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-10-08 09:24:28 +0400 |
commit | 1fa8da9b963e99e08c829fe6491e8ccf2d1054e2 (patch) | |
tree | 137c50850a5f21f1651f8066d4bd381a661e1987 /core/DataTable/Filter/Sort.php | |
parent | fcbef99dbf93df94ff5ed4cfaa5eeebfcf4aac14 (diff) |
Applying phpstorm code style PSR refs #3771
Diffstat (limited to 'core/DataTable/Filter/Sort.php')
-rw-r--r-- | core/DataTable/Filter/Sort.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/core/DataTable/Filter/Sort.php b/core/DataTable/Filter/Sort.php index 1b58a27269..9078c65f08 100644 --- a/core/DataTable/Filter/Sort.php +++ b/core/DataTable/Filter/Sort.php @@ -30,10 +30,10 @@ class Sort extends Filter /** * @param DataTable $table - * @param string $columnToSort name of the column to sort by - * @param string $order order (asc|desc) - * @param bool $naturalSort use natural sort? - * @param bool $recursiveSort sort recursively? + * @param string $columnToSort name of the column to sort by + * @param string $order order (asc|desc) + * @param bool $naturalSort use natural sort? + * @param bool $recursiveSort sort recursively? */ public function __construct($table, $columnToSort, $order = 'desc', $naturalSort = true, $recursiveSort = false) { @@ -49,7 +49,7 @@ class Sort extends Filter /** * Updates the order * - * @param string $order asc|desc + * @param string $order asc|desc */ public function setOrder($order) { @@ -72,7 +72,7 @@ class Sort extends Filter public function sort($a, $b) { return !isset($a->c[Row::COLUMNS][$this->columnToSort]) - && !isset($b->c[Row::COLUMNS][$this->columnToSort]) + && !isset($b->c[Row::COLUMNS][$this->columnToSort]) ? 0 : ( @@ -84,10 +84,10 @@ class Sort extends Filter : (($a->c[Row::COLUMNS][$this->columnToSort] != $b->c[Row::COLUMNS][$this->columnToSort] || !isset($a->c[Row::COLUMNS]['label'])) ? ($this->sign * ( - $a->c[Row::COLUMNS][$this->columnToSort] + $a->c[Row::COLUMNS][$this->columnToSort] < $b->c[Row::COLUMNS][$this->columnToSort] - ? -1 - : 1) + ? -1 + : 1) ) : -1 * $this->sign * strnatcasecmp( $a->c[Row::COLUMNS]['label'], @@ -107,7 +107,7 @@ class Sort extends Filter function naturalSort($a, $b) { return !isset($a->c[Row::COLUMNS][$this->columnToSort]) - && !isset($b->c[Row::COLUMNS][$this->columnToSort]) + && !isset($b->c[Row::COLUMNS][$this->columnToSort]) ? 0 : (!isset($a->c[Row::COLUMNS][$this->columnToSort]) ? 1 @@ -131,16 +131,16 @@ class Sort extends Filter function sortString($a, $b) { return !isset($a->c[Row::COLUMNS][$this->columnToSort]) - && !isset($b->c[Row::COLUMNS][$this->columnToSort]) + && !isset($b->c[Row::COLUMNS][$this->columnToSort]) ? 0 : (!isset($a->c[Row::COLUMNS][$this->columnToSort]) ? 1 : (!isset($b->c[Row::COLUMNS][$this->columnToSort]) ? -1 : $this->sign * - strcasecmp($a->c[Row::COLUMNS][$this->columnToSort], - $b->c[Row::COLUMNS][$this->columnToSort] - ) + strcasecmp($a->c[Row::COLUMNS][$this->columnToSort], + $b->c[Row::COLUMNS][$this->columnToSort] + ) ) ); } |