REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.63 KB
Close
/opt/cpanel/ea-wappspector/vendor/rector/rector/src/Util/NodePrinter.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\Util; use RectorPrefix202411\Nette\Utils\Strings; use PhpParser\Node; use Rector\CustomRules\SimpleNodeDumper; use RectorPrefix202411\Symfony\Component\Console\Style\SymfonyStyle; final class NodePrinter { /** * @readonly * @var \Symfony\Component\Console\Style\SymfonyStyle */ private $symfonyStyle; /** * @var string * @see https://regex101.com/r/Fe8n73/1 */ private const CLASS_NAME_REGEX = '#(?<class_name>PhpParser(.*?))\\(#ms'; /** * @var string * @see https://regex101.com/r/uQFuvL/1 */ private const PROPERTY_KEY_REGEX = '#(?<key>[\\w\\d]+)\\:#'; public function __construct(SymfonyStyle $symfonyStyle) { $this->symfonyStyle = $symfonyStyle; } /** * @param Node|Node[] $nodes */ public function printNodes($nodes) : void { $dumpedNodesContents = SimpleNodeDumper::dump($nodes); // colorize $colorContents = $this->addConsoleColors($dumpedNodesContents); $this->symfonyStyle->writeln($colorContents); $this->symfonyStyle->newLine(); } private function addConsoleColors(string $contents) : string { // decorate class names $colorContents = Strings::replace($contents, self::CLASS_NAME_REGEX, static function (array $match) : string { return '<fg=green>' . $match['class_name'] . '</>('; }); // decorate keys return Strings::replace($colorContents, self::PROPERTY_KEY_REGEX, static function (array $match) : string { return '<fg=yellow>' . $match['key'] . '</>:'; }); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 8
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Reflection
DIR
-
drwxr-xr-x
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ArrayChecker.php
466 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ArrayParametersMerger.php
1.59 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FileHasher.php
1.13 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MemoryLimiter.php
1.40 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NewLineSplitter.php
431 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NodePrinter.php
1.63 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PhpVersionFactory.php
665 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
StringUtils.php
294 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).