Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private function addTwigOptions(ArrayNodeDefinition $rootNode)
->normalizeKeys(false)
->useAttributeAsKey('paths')
->beforeNormalization()
->always()
->ifArray()
->then(function ($paths) {
$normalized = [];
foreach ($paths as $path => $namespace) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,16 @@ public function testArrayKeysInGlobalsAreNotNormalized()

$this->assertSame(['global' => ['value' => ['some-key' => 'some-value']]], $config['globals']);
}

public function testNullPathsAreConvertedToIterable()
{
$input = [
'paths' => null,
];

$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(), [$input]);

$this->assertSame([], $config['paths']);
}
}