Skip to content

Commit 660b0d5

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 72d72f6 + cdadb37 commit 660b0d5

12 files changed

+17
-17
lines changed

ChildDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function setParent($parent)
7171
*/
7272
public function getArgument($index)
7373
{
74-
if (array_key_exists('index_'.$index, $this->arguments)) {
74+
if (\array_key_exists('index_'.$index, $this->arguments)) {
7575
return $this->arguments['index_'.$index];
7676
}
7777

Compiler/AutowirePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private function autowireMethod(\ReflectionFunctionAbstract $reflectionMethod, a
188188
}
189189

190190
foreach ($parameters as $index => $parameter) {
191-
if (array_key_exists($index, $arguments) && '' !== $arguments[$index]) {
191+
if (\array_key_exists($index, $arguments) && '' !== $arguments[$index]) {
192192
continue;
193193
}
194194

Compiler/RegisterServiceSubscribersPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ protected function processValue($value, $isRoot = false)
4343
if ([] !== array_diff(array_keys($attributes), ['id', 'key'])) {
4444
throw new InvalidArgumentException(sprintf('The "container.service_subscriber" tag accepts only the "key" and "id" attributes, "%s" given for service "%s".', implode('", "', array_keys($attributes)), $this->currentId));
4545
}
46-
if (!array_key_exists('id', $attributes)) {
46+
if (!\array_key_exists('id', $attributes)) {
4747
throw new InvalidArgumentException(sprintf('Missing "id" attribute on "container.service_subscriber" tag with key="%s" for service "%s".', $attributes['key'], $this->currentId));
4848
}
49-
if (!array_key_exists('key', $attributes)) {
49+
if (!\array_key_exists('key', $attributes)) {
5050
$attributes['key'] = $attributes['id'];
5151
}
5252
if (isset($serviceMap[$attributes['key']])) {

Compiler/ResolveBindingsPass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,19 @@ protected function processValue($value, $isRoot = false)
119119
}
120120

121121
foreach ($reflectionMethod->getParameters() as $key => $parameter) {
122-
if (array_key_exists($key, $arguments) && '' !== $arguments[$key]) {
122+
if (\array_key_exists($key, $arguments) && '' !== $arguments[$key]) {
123123
continue;
124124
}
125125

126126
$typeHint = ProxyHelper::getTypeHint($reflectionMethod, $parameter);
127127

128-
if (array_key_exists($k = ltrim($typeHint, '\\').' $'.$parameter->name, $bindings)) {
128+
if (\array_key_exists($k = ltrim($typeHint, '\\').' $'.$parameter->name, $bindings)) {
129129
$arguments[$key] = $this->getBindingValue($bindings[$k]);
130130

131131
continue;
132132
}
133133

134-
if (array_key_exists('$'.$parameter->name, $bindings)) {
134+
if (\array_key_exists('$'.$parameter->name, $bindings)) {
135135
$arguments[$key] = $this->getBindingValue($bindings['$'.$parameter->name]);
136136

137137
continue;

Compiler/ResolveNamedArgumentsPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected function processValue($value, $isRoot = false)
7777

7878
$typeFound = false;
7979
foreach ($parameters as $j => $p) {
80-
if (!array_key_exists($j, $resolvedArguments) && ProxyHelper::getTypeHint($r, $p, true) === $key) {
80+
if (!\array_key_exists($j, $resolvedArguments) && ProxyHelper::getTypeHint($r, $p, true) === $key) {
8181
$resolvedArguments[$j] = $argument;
8282
$typeFound = true;
8383
}

Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ protected function getEnv($name)
385385
if (isset($this->resolving[$envName = "env($name)"])) {
386386
throw new ParameterCircularReferenceException(array_keys($this->resolving));
387387
}
388-
if (isset($this->envCache[$name]) || array_key_exists($name, $this->envCache)) {
388+
if (isset($this->envCache[$name]) || \array_key_exists($name, $this->envCache)) {
389389
return $this->envCache[$name];
390390
}
391391
if (!$this->has($id = 'container.env_var_processors_locator')) {

Definition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public function replaceArgument($index, $argument)
269269
throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, \count($this->arguments) - 1));
270270
}
271271

272-
if (!array_key_exists($index, $this->arguments)) {
272+
if (!\array_key_exists($index, $this->arguments)) {
273273
throw new OutOfBoundsException(sprintf('The argument "%s" doesn\'t exist.', $index));
274274
}
275275

@@ -314,7 +314,7 @@ public function getArguments()
314314
*/
315315
public function getArgument($index)
316316
{
317-
if (!array_key_exists($index, $this->arguments)) {
317+
if (!\array_key_exists($index, $this->arguments)) {
318318
throw new OutOfBoundsException(sprintf('The argument "%s" doesn\'t exist.', $index));
319319
}
320320

Dumper/GraphvizDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private function findNodes(): array
171171
}
172172

173173
foreach ($container->getServiceIds() as $id) {
174-
if (array_key_exists($id, $container->getAliases())) {
174+
if (\array_key_exists($id, $container->getAliases())) {
175175
continue;
176176
}
177177

EnvVarProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function getEnv($prefix, $name, \Closure $getEnv)
6969
throw new RuntimeException(sprintf('Resolved value of "%s" did not result in an array value.', $next));
7070
}
7171

72-
if (!isset($array[$key]) && !array_key_exists($key, $array)) {
72+
if (!isset($array[$key]) && !\array_key_exists($key, $array)) {
7373
throw new EnvNotFoundException(sprintf('Key "%s" not found in "%s" (resolved from "%s").', $key, json_encode($array), $next));
7474
}
7575

Extension/Extension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ final public function getProcessedConfigs()
127127
*/
128128
protected function isConfigEnabled(ContainerBuilder $container, array $config)
129129
{
130-
if (!array_key_exists('enabled', $config)) {
130+
if (!\array_key_exists('enabled', $config)) {
131131
throw new InvalidArgumentException("The config array has no 'enabled' key.");
132132
}
133133

LazyProxy/Instantiator/RealServiceInstantiator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/**
1818
* {@inheritdoc}
1919
*
20-
* Noop proxy instantiator - simply produces the real service instead of a proxy instance.
20+
* Noop proxy instantiator - produces the real service instead of a proxy instance.
2121
*
2222
* @author Marco Pivetta <[email protected]>
2323
*/

ParameterBag/ParameterBag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function get($name)
6868
{
6969
$name = (string) $name;
7070

71-
if (!array_key_exists($name, $this->parameters)) {
71+
if (!\array_key_exists($name, $this->parameters)) {
7272
if (!$name) {
7373
throw new ParameterNotFoundException($name);
7474
}
@@ -119,7 +119,7 @@ public function set($name, $value)
119119
*/
120120
public function has($name)
121121
{
122-
return array_key_exists((string) $name, $this->parameters);
122+
return \array_key_exists((string) $name, $this->parameters);
123123
}
124124

125125
/**

0 commit comments

Comments
 (0)