PHPackages                             chx/drupal-pretty-printer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chx/drupal-pretty-printer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chx/drupal-pretty-printer
=========================

Drupal pretty printer

1.0.1(11mo ago)02.6k↑208.9%1GPL-2.0-or-laterPHPCI passing

Since May 13Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/chx/drupal-pretty-printer)[ Packagist](https://packagist.org/packages/chx/drupal-pretty-printer)[ RSS](/packages/chx-drupal-pretty-printer/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (2)Versions (10)Used By (0)

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.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance50

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Recently: every ~1 days

Total

9

Last Release

352d ago

Major Versions

0.7 → 1.0.02025-07-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/193045?v=4)[chx](/maintainers/chx)[@chx](https://github.com/chx)

---

Top Contributors

[![chx](https://avatars.githubusercontent.com/u/193045?v=4)](https://github.com/chx "chx (38 commits)")

### Embed Badge

![Health badge](/badges/chx-drupal-pretty-printer/health.svg)

```
[![Health](https://phpackages.com/badges/chx-drupal-pretty-printer/health.svg)](https://phpackages.com/packages/chx-drupal-pretty-printer)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k8.8M118](/packages/deptrac-deptrac)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

6003.7M96](/packages/roave-backward-compatibility-check)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4814.0M25](/packages/coenjacobs-mozart)[v.chetkov/php-clean-architecture

PHP Clean Architecture

14661.1k](/packages/vchetkov-php-clean-architecture)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
