rector/tests/debug_functions.php
Tomas Votruba 0293296974
extract UseImportNameMatcher (#407)
Co-authored-by: GitHub Action <action@github.com>
2021-07-08 15:49:48 +00:00

27 lines
548 B
PHP

<?php
declare(strict_types=1);
use PhpParser\Node;
use PhpParser\PrettyPrinter\Standard;
require __DIR__ . '/../vendor/autoload.php';
/**
* @param Node|Node[] $node
*/
function print_node(Node | array $node): void
{
$standard = new Standard();
if (is_array($node)) {
foreach ($node as $singleNode) {
$printedContent = $standard->prettyPrint([$singleNode]);
dump($printedContent);
}
} else {
$printedContent = $standard->prettyPrint([$node]);
dump($printedContent);
}
}