Beispiel #1
0
 public function accept(NodeVisitorInterface $visitor)
 {
     // only accept visitors which implement NodeVisitor\Snip\VisitorInterface
     if (!$visitor instanceof VisitorInterface) {
         return;
     }
     if (false !== $visitor->enterPlaceholderValue($this)) {
         //            no need to visit content, because ApplyPlaceholderValue has visited
         //            if (false !== $visitor->enterPlaceholderValueContent($this)) {
         //                $this->visitContent($visitor);
         //            }
         //            $visitor->leavePlaceholderValueContent($this);
         // sometimes this is needed , see example "snip in snip 2"
         if (false !== $visitor->enterPlaceholderValueChilds($this)) {
             $this->visitChilds($visitor);
         }
         $visitor->leavePlaceholderValueChilds($this);
     }
     $visitor->leavePlaceholderValue($this);
 }