function ArrayHelper::isSortedByKey
*
Parameters
list<ArrayKeyValue> $keyValues:
1 call to ArrayHelper::isSortedByKey()
- AlphabeticallySortedByKeysSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Arrays/ AlphabeticallySortedByKeysSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Helpers/ ArrayHelper.php, line 164
Class
- ArrayHelper
- @internal
Namespace
SlevomatCodingStandard\HelpersCode
public static function isSortedByKey(array $keyValues) : bool {
$previousKey = '';
foreach ($keyValues as $keyValue) {
if ($keyValue->isUnpacking()) {
continue;
}
if (strnatcasecmp($previousKey, $keyValue->getKey()) === 1) {
return false;
}
$previousKey = $keyValue->getKey();
}
return true;
}