Skip to content

Commit c2305bb

Browse files
Merge branch '4.2'
* 4.2: (26 commits) Apply php-cs-fixer rule for array_key_exists() [Cache] fix warming up cache.system and apcu [Security] Change FormAuthenticator if condition handles multi-byte characters in autocomplete speed up tests running them without debug flag [Translations] added missing Croatian validators Fix getItems() performance issue with RedisCluster (php-redis) [VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning IntegerType: reject submitted non-integer numbers be keen to newcomers [HttpKernel] Fix possible infinite loop of exceptions fixed CS [Validator] Added missing translations for Afrikaans do not validate non-submitted form fields in PATCH requests Update usage example in ArrayInput doc block. [Console] Prevent ArgvInput::getFirstArgument() from returning an option value [Validator] Fixed duplicate UUID fixed CS [EventDispatcher] Fix unknown priority Avoid mutating the Finder when building the iterator ...
2 parents 223089f + 3896e5a commit c2305bb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Debug/OptionsResolverIntrospector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(OptionsResolver $optionsResolver)
3232
throw new UndefinedOptionsException(sprintf('The option "%s" does not exist.', $option));
3333
}
3434

35-
if (!array_key_exists($option, $this->{$property})) {
35+
if (!\array_key_exists($option, $this->{$property})) {
3636
throw new NoConfigurationException($message);
3737
}
3838

OptionsResolver.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public function setDefault($option, $value)
219219
// to resolve options with lazy closures, normalizers or validation
220220
// rules, none of which can exist for undefined options
221221
// If the option was resolved before, update the resolved value
222-
if (!isset($this->defined[$option]) || array_key_exists($option, $this->resolved)) {
222+
if (!isset($this->defined[$option]) || \array_key_exists($option, $this->resolved)) {
223223
$this->resolved[$option] = $value;
224224
}
225225

@@ -259,7 +259,7 @@ public function setDefaults(array $defaults)
259259
*/
260260
public function hasDefault($option)
261261
{
262-
return array_key_exists($option, $this->defaults);
262+
return \array_key_exists($option, $this->defaults);
263263
}
264264

265265
/**
@@ -324,7 +324,7 @@ public function getRequiredOptions()
324324
*/
325325
public function isMissing($option)
326326
{
327-
return isset($this->required[$option]) && !array_key_exists($option, $this->defaults);
327+
return isset($this->required[$option]) && !\array_key_exists($option, $this->defaults);
328328
}
329329

330330
/**
@@ -800,7 +800,7 @@ public function offsetGet($option/*, bool $triggerDeprecation = true*/)
800800
$triggerDeprecation = 1 === \func_num_args() || \func_get_arg(1);
801801

802802
// Shortcut for resolved options
803-
if (isset($this->resolved[$option]) || array_key_exists($option, $this->resolved)) {
803+
if (isset($this->resolved[$option]) || \array_key_exists($option, $this->resolved)) {
804804
if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || $this->calling) && \is_string($this->deprecated[$option])) {
805805
@trigger_error(strtr($this->deprecated[$option], ['%name%' => $option]), E_USER_DEPRECATED);
806806
}
@@ -809,7 +809,7 @@ public function offsetGet($option/*, bool $triggerDeprecation = true*/)
809809
}
810810

811811
// Check whether the option is set at all
812-
if (!isset($this->defaults[$option]) && !array_key_exists($option, $this->defaults)) {
812+
if (!isset($this->defaults[$option]) && !\array_key_exists($option, $this->defaults)) {
813813
if (!isset($this->defined[$option])) {
814814
throw new NoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
815815
}
@@ -1033,7 +1033,7 @@ public function offsetExists($option)
10331033
throw new AccessException('Array access is only supported within closures of lazy options and normalizers.');
10341034
}
10351035

1036-
return array_key_exists($option, $this->defaults);
1036+
return \array_key_exists($option, $this->defaults);
10371037
}
10381038

10391039
/**

0 commit comments

Comments
 (0)