function PrettyPrinterAbstract::pStmts
Pretty prints an array of nodes (statements) and indents them optionally.
Parameters
Node[] $nodes Array of nodes:
bool $indent Whether to indent the printed nodes:
Return value
string Pretty printed statements
28 calls to PrettyPrinterAbstract::pStmts()
- 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.
- Standard::pClassCommon in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinter/ Standard.php - Standard::pExpr_Closure in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinter/ Standard.php - Standard::pParam in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinter/ Standard.php
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php, line 348
Class
Namespace
PhpParserCode
protected function pStmts(array $nodes, bool $indent = true) : string {
if ($indent) {
$this->indent();
}
$result = '';
foreach ($nodes as $node) {
$comments = $node->getComments();
if ($comments) {
$result .= $this->nl . $this->pComments($comments);
if ($node instanceof Stmt\Nop) {
continue;
}
}
$result .= $this->nl . $this->p($node);
}
if ($indent) {
$this->outdent();
}
return $result;
}