mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-08 04:10:51 +00:00
0293296974
Co-authored-by: GitHub Action <action@github.com>
27 lines
548 B
PHP
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);
|
|
}
|
|
}
|