Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
PhpParser(.*?))\\(#ms';
/**
* @var string
* @see https://regex101.com/r/uQFuvL/1
*/
private const PROPERTY_KEY_REGEX = '#(?[\\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 '' . $match['class_name'] . '>(';
});
// decorate keys
return Strings::replace($colorContents, self::PROPERTY_KEY_REGEX, static function (array $match) : string {
return '' . $match['key'] . '>:';
});
}
}