Check that the use tag is allowed before resolving trait templates

This commit is contained in:
Fabien Potencier
2026-09-07 09:11:31 +02:00
parent 9d2d35faa7
commit 18863f0371
8 changed files with 140 additions and 3 deletions
+2 -1
View File
@@ -218,7 +218,8 @@ final class ModuleNode extends Node implements CoercesChildrenToStringInterface
$countTraits = \count($this->getNode('traits'));
if ($countTraits) {
// traits
$compiler->write("\$this->ensureTraitsAllowed();\n\n");
foreach ($this->getNode('traits') as $i => $trait) {
$node = $trait->getNode('template');