PHPackages                             matthiasnoback/php-parser-instantiation-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. matthiasnoback/php-parser-instantiation-printer

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

matthiasnoback/php-parser-instantiation-printer
===============================================

v0.3.0(2y ago)14163.5k↓44.6%2MITPHPPHP ^8.0

Since Oct 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/matthiasnoback/php-parser-instantiation-printer)[ Packagist](https://packagist.org/packages/matthiasnoback/php-parser-instantiation-printer)[ RSS](/packages/matthiasnoback-php-parser-instantiation-printer/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (4)Dependencies (4)Versions (7)Used By (0)

This project provides a so-called [InstantiationPrinter](src/InstantiationPrinter.php). I'm not the only one who has attempted to build such a thing: [nikic/PHP-Parser#566](https://github.com/nikic/PHP-Parser/issues/566)

Example: `$instance = new self();`In PHP-Parser nodes this will be:

```
array(
    0: Stmt_Expression(
        expr: Expr_Assign(
            var: Expr_Variable(
                name: instance
            )
            expr: Expr_New(
                class: Name(
                    parts: array(
                        0: self
                    )
                )
                args: array(
                )
            )
        )
    )
)

```

When printed by the `InstantiationPrinter` this becomes:

```
new PhpParser\Node\Stmt\Expression(
    new PhpParser\Node\Expr\Assign(
        new PhpParser\Node\Expr\Variable('instance'),
        new PhpParser\Node\Expr\New_(
            new PhpParser\Node\Name('self')
        )
    )
);
```

Usage
-----

[](#usage)

Install this library in your project:

```
composer require --dev matthiasnoback/php-parser-instantiation-printer
```

You'll have command-line tool now, that generates the nodes based on the provided PHP script:

```
bin/print-node-instantiation-code temp.php
```

(if you don't have a `bin/` directory in your project, try `vendor/bin`)

You can also instantiate your own `InstantiationPrinter` service. Take a look at the code in the `print-node-instantiation-code` script to find out how to accomplish this.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96% 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 ~426 days

Total

4

Last Release

808d ago

PHP version history (3 changes)v0.1.0PHP ^7.4

v0.1.1PHP ^7.4|^8.0

v0.3.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1193078?v=4)[Matthias Noback](/maintainers/matthiasnoback)[@matthiasnoback](https://github.com/matthiasnoback)

---

Top Contributors

[![matthiasnoback](https://avatars.githubusercontent.com/u/1193078?v=4)](https://github.com/matthiasnoback "matthiasnoback (24 commits)")[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matthiasnoback-php-parser-instantiation-printer/health.svg)

```
[![Health](https://phpackages.com/badges/matthiasnoback-php-parser-instantiation-printer/health.svg)](https://phpackages.com/packages/matthiasnoback-php-parser-instantiation-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)
