承接 chx/drupal-pretty-printer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

chx/drupal-pretty-printer

最新稳定版本:1.0.1

Composer 安装命令:

composer require chx/drupal-pretty-printer

包简介

Drupal pretty printer

README 文档

README

This is a drop in replacement for PhpParser\PrettyPrinter\Standard printing Drupal coding style.

Recommended usage:

[$printer, $stmts] = DrupalPrettyPrinter::getPrinterAndParse($code);

This parses the code and returns the printer and the parsed statements. It recognizes PHP 8.2 syntax for parsing or later with the nikic/php-parser v5. The printer is ready for a $printer->printFormatPreserving($stmts) call, unlike with the standard printer, no other arguments are needed.

Of course, a simple

$printer = new DrupalPrettyPrinter();
$printer->prettyPrint($stmts);

also works. The factory method is just a convenience.

统计信息

  • 总下载量: 786
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2025-05-13