mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-23 19:24:48 +01:00
27 lines
535 B
PHP
27 lines
535 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): 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);
|
||
|
}
|
||
|
}
|