mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-08 04:10:51 +00:00
0c54ea5aa9
4680c56d00
Bump Rector package deps (#1087)
41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace RectorPrefix20211027;
|
|
|
|
use PhpParser\Node;
|
|
use PhpParser\PrettyPrinter\Standard;
|
|
use RectorPrefix20211027\Tracy\Dumper;
|
|
if (!\function_exists('dn')) {
|
|
function dn(\PhpParser\Node $node, int $depth = 2) : void
|
|
{
|
|
\RectorPrefix20211027\dump_node($node, $depth);
|
|
}
|
|
}
|
|
if (!\function_exists('dump_node')) {
|
|
/**
|
|
* @param \PhpParser\Node|mixed[] $node
|
|
*/
|
|
function dump_node($node, int $depth = 2) : void
|
|
{
|
|
$nodes = \is_array($node) ? $node : [$node];
|
|
foreach ($nodes as $node) {
|
|
\RectorPrefix20211027\Tracy\Dumper::dump($node, [\RectorPrefix20211027\Tracy\Dumper::DEPTH => $depth]);
|
|
}
|
|
}
|
|
}
|
|
if (!\function_exists('print_node')) {
|
|
/**
|
|
* @param \PhpParser\Node|mixed[] $node
|
|
*/
|
|
function print_node($node) : void
|
|
{
|
|
$standard = new \PhpParser\PrettyPrinter\Standard();
|
|
$nodes = \is_array($node) ? $node : [$node];
|
|
foreach ($nodes as $node) {
|
|
$printedContent = $standard->prettyPrint([$node]);
|
|
\RectorPrefix20211027\Tracy\Dumper::dump($printedContent);
|
|
}
|
|
}
|
|
}
|