Beispiel #1
0
 public function visitNamespaceNode(NamespaceNode $node)
 {
     $first = $node->getBody()->firstToken();
     $has_braces = $first->getType() === '{';
     $this->indentLevel = $has_braces ? 1 : 0;
     if (!$has_braces) {
         foreach ($node->children(Filter::isTokenType(';')) as $semicolon) {
             $next = $semicolon->next();
             $newlines = str_repeat($this->config['nl'], 2);
             if ($next instanceof WhitespaceNode) {
                 $next->setText($newlines);
             } else {
                 $semicolon->after(Token::whitespace($newlines));
             }
         }
     }
 }