Skip to content

Commit 352700b

Browse files
authored
Merge pull request #219 from hgraca/patch-3-empty_type_file
cast to array the result of parsing yml and xml.
2 parents 9ab16c9 + 106a41c commit 352700b

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Config/Parser/XmlParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public static function parse(SplFileInfo $file, ContainerBuilder $container)
4343
throw new InvalidArgumentException(sprintf('Unable to parse file "%s".', $file), $e->getCode(), $e);
4444
}
4545

46-
return $typesConfig;
46+
return (array) $typesConfig;
4747
}
4848
}

Config/Parser/YamlParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ public static function parse(SplFileInfo $file, ContainerBuilder $container)
4141
throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $file), 0, $e);
4242
}
4343

44-
return $typesConfig;
44+
return (array) $typesConfig;
4545
}
4646
}

Tests/DependencyInjection/OverblogGraphQLTypesExtensionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testDuplicatedType()
6161
*/
6262
public function testBrokenYmlOnPrepend()
6363
{
64-
$this->extension->containerPrependExtensionConfig($this->getBrokenMappingConfig('yaml'), $this->container);
64+
$this->extension->containerPrependExtensionConfig($this->getMappingConfig('yaml'), $this->container);
6565
}
6666

6767
/**
@@ -70,7 +70,7 @@ public function testBrokenYmlOnPrepend()
7070
*/
7171
public function testBrokenXmlOnPrepend()
7272
{
73-
$this->extension->containerPrependExtensionConfig($this->getBrokenMappingConfig('xml'), $this->container);
73+
$this->extension->containerPrependExtensionConfig($this->getMappingConfig('xml'), $this->container);
7474
}
7575

7676
/**
@@ -259,7 +259,7 @@ public function internalConfigKeys()
259259
];
260260
}
261261

262-
private function getBrokenMappingConfig($type)
262+
private function getMappingConfig($type)
263263
{
264264
$config = [
265265
'definitions' => [

Tests/DependencyInjection/mapping/xml/empty.types.xml

Whitespace-only changes.

Tests/DependencyInjection/mapping/yaml/empty.types.yml

Whitespace-only changes.

0 commit comments

Comments
 (0)