diff --git a/src/Utility/Hash.php b/src/Utility/Hash.php index 7539adf12bf..c1439d3ce14 100644 --- a/src/Utility/Hash.php +++ b/src/Utility/Hash.php @@ -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) { diff --git a/tests/TestCase/Utility/HashTest.php b/tests/TestCase/Utility/HashTest.php index 955737b1139..6580557413c 100644 --- a/tests/TestCase/Utility/HashTest.php +++ b/tests/TestCase/Utility/HashTest.php @@ -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']], @@ -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); } /**