8000 The 'config' variable is already used as an array expression less... · symfony/symfony@f15d179 · GitHub
[go: up one dir, main page]

Skip to content

Commit f15d179

Browse files
tecnocatfabpot
authored andcommitted
The 'config' variable is already used as an array expression less...
1 parent 36306ab commit f15d179

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Routing/Loader/YamlFileLoader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function load($file, $type = null)
5858
}
5959

6060
try {
61-
$config = $this->yamlParser->parse(file_get_contents($path));
61+
$parsedConfig = $this->yamlParser->parse(file_get_contents($path));
6262
} catch (ParseException $e) {
6363
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e);
6464
}
@@ -67,16 +67,16 @@ public function load($file, $type = null)
6767
$collection->addResource(new FileResource($path));
6868

6969
// empty file
70-
if (null === $config) {
70+
if (null === $parsedConfig) {
7171
return $collection;
7272
}
7373

7474
// not an array
75-
if (!is_array($config)) {
75+
if (!is_array($parsedConfig)) {
7676
throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $path));
7777
}
7878

79-
foreach ($config as $name => $config) {
79+
foreach ($parsedConfig as $name => $config) {
8080
if (isset($config['pattern'])) {
8181
if (isset($config['path'])) {
8282
throw new \InvalidArgumentException(sprintf('The file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));

0 commit comments

Comments
 (0)
0