Skip to content

Commit 16431b6

Browse files
committed
fix: Resolve dist file path from import
1 parent 24c1609 commit 16431b6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/Configuration/Loader/DistFileLoader.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
33

44
namespace GrumPHP\Configuration\Loader;
55

6+
use Symfony\Component\Config\FileLocatorInterface;
7+
use Symfony\Component\Config\Loader\FileLoader;
68
use Symfony\Component\Config\Loader\LoaderInterface;
79
use Symfony\Component\Config\Loader\LoaderResolverInterface;
810

911
/**
1012
* A decorating dist loader that supports **.dist files and defers loading.
1113
*/
12-
final class DistFileLoader implements LoaderInterface
14+
final class DistFileLoader extends FileLoader implements LoaderInterface
1315
{
1416
private LoaderInterface $loader;
1517

16-
public function __construct(LoaderInterface $loader)
18+
public function __construct(LoaderInterface $loader, FileLocatorInterface $locator, ?string $env = null)
1719
{
20+
parent::__construct($locator, $env);
1821
$this->loader = $loader;
1922
}
2023

src/Configuration/LoaderFactory.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public static function createLoader(ContainerBuilder $container, array $paths =
3030
$iniLoader = new IniFileLoader($container, $locator, self::ENV),
3131
new GlobFileLoader($container, $locator, self::ENV),
3232
new DirectoryLoader($container, $locator, self::ENV),
33-
new DistFileLoader($xmlLoader),
34-
new DistFileLoader($yamlLoader),
35-
new DistFileLoader($iniLoader),
33+
new DistFileLoader($xmlLoader, $locator),
34+
new DistFileLoader($yamlLoader, $locator),
35+
new DistFileLoader($iniLoader, $locator),
3636
]);
3737

3838
return new DelegatingLoader($resolver);

0 commit comments

Comments
 (0)