Skip to content

Commit 7a7703a

Browse files
thundererTobion
authored andcommitted
[Routing][DependencyInjection] Support .yaml extension in YAML loaders
1 parent d7e8b0b commit 7a7703a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function load($resource, $type = null)
7373
*/
7474
public function supports($resource, $type = null)
7575
{
76-
return is_string($resource) && 'yml' === pathinfo($resource, PATHINFO_EXTENSION);
76+
return is_string($resource) && in_array(pathinfo($resource, PATHINFO_EXTENSION), array('yml', 'yaml'), true);
7777
}
7878

7979
/**

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ public function testSupports()
187187
$loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator());
188188

189189
$this->assertTrue($loader->supports('foo.yml'), '->supports() returns true if the resource is loadable');
190+
$this->assertTrue($loader->supports('foo.yaml'), '->supports() returns true if the resource is loadable');
190191
$this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable');
191192
}
192193

0 commit comments

Comments
 (0)