From dc76cfdcf0521552667d44395a2290a5c8e48281 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 29 Feb 2016 22:14:08 +0100 Subject: Fixed 10 "critical" issues found by scrutinizer * create function => closures * removed var_dump from tests --- .../protected/pages/Controls/Samples/TDataGrid/Sample4.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'demos/quickstart/protected/pages/Controls') diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample4.php b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample4.php index 201fc5f9..766e4d55 100755 --- a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample4.php +++ b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample4.php @@ -6,9 +6,14 @@ class Sample4 extends Sample2 { protected function sortData($data,$key) { - $compare = create_function('$a,$b','if ($a["'.$key.'"] == $b["'.$key.'"]) {return 0;}else {return ($a["'.$key.'"] > $b["'.$key.'"]) ? 1 : -1;}'); - usort($data,$compare) ; - return $data ; + usort($data, function($a, $b) use ($key) { + if ($a[$key] == $b[$key]) { + return 0; + } else { + return ($a[$key] > $b[$key]) ? 1 : -1; + } + }); + return $data; } public function sortDataGrid($sender,$param) -- cgit v1.2.3