Skip to content

Commit 6b25a86

Browse files
Apply php-cs-fixer rule for array_key_exists()
1 parent bf4376d commit 6b25a86

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

Generator/UrlGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa
139139
$message = 'Parameter "{parameter}" for route "{route}" must match "{expected}" ("{given}" given) to generate a corresponding URL.';
140140
foreach ($tokens as $token) {
141141
if ('variable' === $token[0]) {
142-
if (!$optional || !array_key_exists($token[3], $defaults) || null !== $mergedParams[$token[3]] && (string) $mergedParams[$token[3]] !== (string) $defaults[$token[3]]) {
142+
if (!$optional || !\array_key_exists($token[3], $defaults) || null !== $mergedParams[$token[3]] && (string) $mergedParams[$token[3]] !== (string) $defaults[$token[3]]) {
143143
// check requirement (while ignoring look-around patterns)
144144
if (null !== $this->strictRequirements && !preg_match('#^'.preg_replace('/\(\?(?:=|<=|!|<!)((?:[^()\\\\]+|\\\\.|\((?1)\))*)\)/', '', $token[2]).'$#'.(empty($token[4]) ? '' : 'u'), $mergedParams[$token[3]])) {
145145
if ($this->strictRequirements) {

Matcher/Dumper/DumperCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected function setParent(self $parent)
120120
*/
121121
public function hasAttribute($name)
122122
{
123-
return array_key_exists($name, $this->attributes);
123+
return \array_key_exists($name, $this->attributes);
124124
}
125125

126126
/**

RequestContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public function getParameter($name)
316316
*/
317317
public function hasParameter($name)
318318
{
319-
return array_key_exists($name, $this->parameters);
319+
return \array_key_exists($name, $this->parameters);
320320
}
321321

322322
/**

Route.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function getOption($name)
314314
*/
315315
public function hasOption($name)
316316
{
317-
return array_key_exists($name, $this->options);
317+
return \array_key_exists($name, $this->options);
318318
}
319319

320320
/**
@@ -383,7 +383,7 @@ public function getDefault($name)
383383
*/
384384
public function hasDefault($name)
385385
{
386-
return array_key_exists($name, $this->defaults);
386+
return \array_key_exists($name, $this->defaults);
387387
}
388388

389389
/**
@@ -468,7 +468,7 @@ public function getRequirement($key)
468468
*/
469469
public function hasRequirement($key)
470470
{
471-
return array_key_exists($key, $this->requirements);
471+
return \array_key_exists($key, $this->requirements);
472472
}
473473

474474
/**

Router.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function setOptions(array $options)
142142
// check option names and live merge, if errors are encountered Exception will be thrown
143143
$invalid = [];
144144
foreach ($options as $key => $value) {
145-
if (array_key_exists($key, $this->options)) {
145+
if (\array_key_exists($key, $this->options)) {
146146
$this->options[$key] = $value;
147147
} else {
148148
$invalid[] = $key;
@@ -164,7 +164,7 @@ public function setOptions(array $options)
164164
*/
165165
public function setOption($key, $value)
166166
{
167-
if (!array_key_exists($key, $this->options)) {
167+
if (!\array_key_exists($key, $this->options)) {
168168
throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key));
169169
}
170170

@@ -182,7 +182,7 @@ public function setOption($key, $value)
182182
*/
183183
public function getOption($key)
184184
{
185-
if (!array_key_exists($key, $this->options)) {
185+
if (!\array_key_exists($key, $this->options)) {
186186
throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key));
187187
}
188188

0 commit comments

Comments
 (0)