Skip to content

Commit cdadb37

Browse files
Merge branch '3.4' into 4.2
* 3.4: (24 commits) Apply php-cs-fixer rule for array_key_exists() [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 [Validator] Add the missing translations for the Greek (el) locale ...
2 parents b59f729 + c3dd7b7 commit cdadb37

14 files changed

+24
-24
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
@@ -189,7 +189,7 @@ private function autowireMethod(\ReflectionFunctionAbstract $reflectionMethod, a
189189
}
190190

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

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
@@ -65,7 +65,7 @@ public function getEnv($prefix, $name, \Closure $getEnv)
6565
if (!\is_array($array)) {
6666
throw new RuntimeException(sprintf('Resolved value of "%s" did not result in an array value.', $next));
6767
}
68-
if (!array_key_exists($key, $array)) {
68+
if (!\array_key_exists($key, $array)) {
6969
throw new RuntimeException(sprintf('Key "%s" not found in "%s" (resolved from "%s")', $key, json_encode($array), $next));
7070
}
7171

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

0 commit comments

Comments
 (0)