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