mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 09:14:09 +02:00
ArrayElementByPosition: phpcs bug
This commit is contained in:
parent
79620849c7
commit
9cf513f8aa
@ -81,12 +81,14 @@ class PropertyModifierArrayElementByPosition extends PropertyModifierHook
|
||||
} else {
|
||||
return array_shift($value);
|
||||
}
|
||||
// https://github.com/squizlabs/PHP_CodeSniffer/pull/1363
|
||||
case 'last':
|
||||
if (empty($value)) {
|
||||
return $this->emptyValue($value);
|
||||
} else {
|
||||
return array_pop($value);
|
||||
}
|
||||
// https://github.com/squizlabs/PHP_CodeSniffer/pull/1363
|
||||
case 'fixed':
|
||||
$pos = $this->getSetting('position');
|
||||
if (! is_int($pos) && ! ctype_digit($pos)) {
|
||||
@ -102,6 +104,7 @@ class PropertyModifierArrayElementByPosition extends PropertyModifierHook
|
||||
} else {
|
||||
return $this->emptyValue($value);
|
||||
}
|
||||
// https://github.com/squizlabs/PHP_CodeSniffer/pull/1363
|
||||
default:
|
||||
throw new ConfigurationError(
|
||||
'"%s" is not a valid array position_type',
|
||||
|
Loading…
x
Reference in New Issue
Block a user