Skip to content
Permalink
Browse files

Use array() instead of the short notation []

  • Loading branch information...
Adrian Gunawan
Adrian Gunawan committed Aug 14, 2015
1 parent f23e658 commit b89d8d5efa3e22f79480fb2c08105d40661b7d4d
Showing with 5 additions and 5 deletions.
  1. +4 −4 lib/Cake/Test/Case/Utility/HashTest.php
  2. +1 −1 lib/Cake/Utility/Hash.php
@@ -1317,7 +1317,7 @@ public function testSortNaturalIgnoreCase() {
array('Item' => array('image' => 'Img10.jpg')),
array('Item' => array('image' => 'img2.jpg')),
);
$result = Hash::sort($items, '{n}.Item.image', 'desc', ['type' => 'natural', 'ignoreCase' => true]);
$result = Hash::sort($items, '{n}.Item.image', 'desc', array('type' => 'natural', 'ignoreCase' => true));
$expected = array(
array('Item' => array('image' => 'img99.jpg')),
array('Item' => array('image' => 'Img12.jpg')),
@@ -1327,7 +1327,7 @@ public function testSortNaturalIgnoreCase() {
);
$this->assertEquals($expected, $result);
$result = Hash::sort($items, '{n}.Item.image', 'asc', ['type' => 'natural', 'ignoreCase' => true]);
$result = Hash::sort($items, '{n}.Item.image', 'asc', array('type' => 'natural', 'ignoreCase' => true));
$expected = array(
array('Item' => array('image' => 'img1.jpg')),
array('Item' => array('image' => 'img2.jpg')),
@@ -1436,7 +1436,7 @@ public function testSortStringIgnoreCase() {
array('Item' => array('name' => 'Baz')),
array('Item' => array('name' => 'bat')),
);
$sorted = Hash::sort($toSort, '{n}.Item.name', 'asc', ['type' => 'string', 'ignoreCase' => true]);
$sorted = Hash::sort($toSort, '{n}.Item.name', 'asc', array('type' => 'string', 'ignoreCase' => true));
$expected = array(
array('Item' => array('name' => 'Baby')),
array('Item' => array('name' => 'bar')),
@@ -1458,7 +1458,7 @@ public function testSortRegularIgnoreCase() {
array('Item' => array('name' => 'Baz')),
array('Item' => array('name' => 'bat')),
);
$sorted = Hash::sort($toSort, '{n}.Item.name', 'asc', ['type' => 'regular', 'ignoreCase' => true]);
$sorted = Hash::sort($toSort, '{n}.Item.name', 'asc', array('type' => 'regular', 'ignoreCase' => true));
$expected = array(
array('Item' => array('name' => 'Baby')),
array('Item' => array('name' => 'bar')),
@@ -839,7 +839,7 @@ public static function apply(array $data, $path, $function) {
* - `natural` Compare items as strings using "natural ordering" in a human friendly way.
* Will sort foo10 below foo2 as an example. Requires PHP 5.4 or greater or it will fallback to 'regular'
* To do case insensitive sorting, pass the type as an array as follows:
* ['type' => 'regular', 'ignoreCase' => true]
* array('type' => 'regular', 'ignoreCase' => true)
*
* @param array $data An array of data to sort
* @param string $path A Set-compatible path to the array value

0 comments on commit b89d8d5

Please sign in to comment.
You can’t perform that action at this time.