Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix indentation for the locale option in Hash::sort
  • Loading branch information
hytromo committed Aug 23, 2016
1 parent 5cb40cb commit ce90e5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/Utility/Hash.php
Expand Up @@ -999,9 +999,9 @@ public static function sort(array $data, $path, $dir = 'asc', $type = 'regular')
$type = SORT_STRING;
} elseif ($type === 'natural') {
$type = SORT_NATURAL;
} elseif ($type === 'locale') {
$type = SORT_LOCALE_STRING;
} else {
} elseif ($type === 'locale') {
$type = SORT_LOCALE_STRING;
} else {
$type = SORT_REGULAR;
}
if ($ignoreCase) {
Expand Down
12 changes: 6 additions & 6 deletions tests/TestCase/Utility/HashTest.php
Expand Up @@ -1684,11 +1684,11 @@ public function testSortNatural()
*/
public function testSortLocale()
{
// get the current locale
$oldLocale = setlocale(LC_COLLATE, '0');
// get the current locale
$oldLocale = setlocale(LC_COLLATE, '0');

// the de_DE.utf8 locale must be installed on the system where the test is performed
setlocale(LC_COLLATE, 'de_DE.utf8');
// the de_DE.utf8 locale must be installed on the system where the test is performed
setlocale(LC_COLLATE, 'de_DE.utf8');

$items = [
['Item' => ['entry' => 'Übergabe']],
Expand All @@ -1706,8 +1706,8 @@ public function testSortLocale()
];
$this->assertEquals($expected, $result);

// change to the original locale
setlocale(LC_COLLATE, $oldLocale);
// change to the original locale
setlocale(LC_COLLATE, $oldLocale);
}

/**
Expand Down

0 comments on commit ce90e5e

Please sign in to comment.