Skip to content

Commit

Permalink
Use array() instead of the short notation []
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Gunawan committed Aug 14, 2015
1 parent f23e658 commit b89d8d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/Test/Case/Utility/HashTest.php
Expand Up @@ -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')),
Expand All @@ -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')),
Expand Down Expand Up @@ -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')),
Expand All @@ -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')),
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Utility/Hash.php
Expand Up @@ -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
Expand Down

0 comments on commit b89d8d5

Please sign in to comment.