function PrettyPrinterAbstract::preprocessNodes
Preprocesses the top-level nodes to initialize pretty printer state.
Parameters
Node[] $nodes Array of nodes:
2 calls to PrettyPrinterAbstract::preprocessNodes()
- PrettyPrinterAbstract::prettyPrint in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php - Pretty prints an array of statements.
- PrettyPrinterAbstract::printFormatPreserving in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php - Perform a format-preserving pretty print of an AST.
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php, line 313
Class
Namespace
PhpParserCode
protected function preprocessNodes(array $nodes) : void {
/* We can use semicolon-namespaces unless there is a global namespace declaration */
$this->canUseSemicolonNamespaces = true;
foreach ($nodes as $node) {
if ($node instanceof Stmt\Namespace_ && null === $node->name) {
$this->canUseSemicolonNamespaces = false;
break;
}
}
}