-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Description
The form visitors stop child propagation with the check below. This means custom visitors added after the form visitors will not get the chance to evaluate the code.
I believe the fix should happen here and not in the symfony bundle for php-translation.
(Using ordering in the compiler pass could be a workaround for this issue, but it should not be the main fix)
Using this code:
// only Traverse *Type
if ($node instanceof Stmt\Class_) {
if (substr($node->name, -4) !== 'Type') {
return NodeTraverser::DONT_TRAVERSE_CHILDREN;
}
}Maybe using something like this could correctly solve the problem.
/**
* @var Stmt\Class_
*/
protected $class;
/**
* @inheritdoc
*/
public function beforeTraverse(array $nodes)
{
foreach($nodes as $node) {
if ($node instanceof Stmt\Class_) {
$this->class = $node;
}
}
}
if ($this->class instanceof Stmt\Class_) {
if (substr($this->class->name, -4) !== 'Type') {
return;
}What do you think?
Metadata
Metadata
Assignees
Labels
No labels