Skip to content

Commit 7b93b69

Browse files
authored
Add default empty array in constructor
This class its constructor argument `$tagGenerators` is empty by default in PHP, so that via DI argument types in `di.xml` files the array is filled automatically. This actually means that - without any runtime configuration of this argument - the PHP class has a required argument `$tagGenerators`. In my cases, this is breaking DI compile when the modules `Magento_DirectoryGraphQl` and `Magento_StoreGraphQl` are disabled (and actually a lot of people will disable this module if they are not building a headless shop). This PR is a simple but required fix.
1 parent 9e2eb99 commit 7b93b69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Store/Model/Config/Cache/Tag/Strategy/CompositeTagGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CompositeTagGenerator implements TagGeneratorInterface
2323
* @param TagGeneratorInterface[] $tagGenerators
2424
*/
2525
public function __construct(
26-
array $tagGenerators
26+
array $tagGenerators = []
2727
) {
2828
$this->tagGenerators = $tagGenerators;
2929
}

0 commit comments

Comments
 (0)