Skip to content

Commit 177a276

Browse files
Apply php-cs-fixer rule for array_key_exists()
1 parent 00b7402 commit 177a276

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Definition/ArrayNode.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function preNormalize($value)
5959
$normalized = [];
6060

6161
foreach ($value as $k => $v) {
62-
if (false !== strpos($k, '-') && false === strpos($k, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) {
62+
if (false !== strpos($k, '-') && false === strpos($k, '_') && !\array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) {
6363
$normalized[$normalizedKey] = $v;
6464
} else {
6565
$normalized[$k] = $v;
@@ -223,7 +223,7 @@ protected function finalizeValue($value)
223223
}
224224

225225
foreach ($this->children as $name => $child) {
226-
if (!array_key_exists($name, $value)) {
226+
if (!\array_key_exists($name, $value)) {
227227
if ($child->isRequired()) {
228228
$ex = new InvalidConfigurationException(sprintf('The child node "%s" at path "%s" must be configured.', $name, $this->getPath()));
229229
$ex->setPath($this->getPath());
@@ -359,7 +359,7 @@ protected function mergeValues($leftSide, $rightSide)
359359

360360
foreach ($rightSide as $k => $v) {
361361
// no conflict
362-
if (!array_key_exists($k, $leftSide)) {
362+
if (!\array_key_exists($k, $leftSide)) {
363363
if (!$this->allowNewKeys) {
364364
$ex = new InvalidConfigurationException(sprintf('You are not allowed to define new elements for path "%s". Please define all elements for this path in one config file. If you are trying to overwrite an element, make sure you redefine it with the same name.', $this->getPath()));
365365
$ex->setPath($this->getPath());

Definition/PrototypedArrayNode.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ protected function normalizeValue($value)
245245
// if only "value" is left
246246
if (array_keys($v) === ['value']) {
247247
$v = $v['value'];
248-
if ($this->prototype instanceof ArrayNode && ($children = $this->prototype->getChildren()) && array_key_exists('value', $children)) {
248+
if ($this->prototype instanceof ArrayNode && ($children = $this->prototype->getChildren()) && \array_key_exists('value', $children)) {
249249
$valuePrototype = current($this->valuePrototypes) ?: clone $children['value'];
250250
$valuePrototype->parent = $this;
251251
$originalClosures = $this->prototype->normalizationClosures;
@@ -258,7 +258,7 @@ protected function normalizeValue($value)
258258
}
259259
}
260260

261-
if (array_key_exists($k, $normalized)) {
261+
if (\array_key_exists($k, $normalized)) {
262262
$ex = new DuplicateKeyException(sprintf('Duplicate key "%s" for path "%s".', $k, $this->getPath()));
263263
$ex->setPath($this->getPath());
264264

@@ -308,7 +308,7 @@ protected function mergeValues($leftSide, $rightSide)
308308
}
309309

310310
// no conflict
311-
if (!array_key_exists($k, $leftSide)) {
311+
if (!\array_key_exists($k, $leftSide)) {
312312
if (!$this->allowNewKeys) {
313313
$ex = new InvalidConfigurationException(sprintf('You are not allowed to define new elements for path "%s". Please define all elements for this path in one config file.', $this->getPath()));
314314
$ex->setPath($this->getPath());

0 commit comments

Comments
 (0)