Skip to content

Commit 32a8ca3

Browse files
Fix config validation is keys are used defining the "root_sass" paths
1 parent b942232 commit 32a8ca3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/DependencyInjection/SymfonycastsSassExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function getConfigTreeBuilder(): TreeBuilder
6161
->end()
6262
->validate()
6363
->ifTrue(static function (array $paths): bool {
64-
if (1 === \count($paths)) {
64+
if (1 === \count($paths) || !array_is_list($paths)) {
6565
return false;
6666
}
6767

tests/ConfigurationTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ public function testMultipleSassRootPaths(): void
4747
]);
4848
}
4949

50+
public function testMultipleSassRootPathsWithIdentifier(): void
51+
{
52+
$this->assertConfigurationIsValid([
53+
'symfonycasts_sass' => [
54+
'root_sass' => [
55+
'website' => '%kernel.project_dir%/assets/scss/app.scss',
56+
'admin' => '%kernel.project_dir%/assets/admin/scss/app.scss',
57+
],
58+
],
59+
]);
60+
}
61+
5062
public function testMultipleSassRootPathsWithSameFilename(): void
5163
{
5264
$this->assertConfigurationIsInvalid([

0 commit comments

Comments
 (0)