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)14140.9k—7.2%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 1mo 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 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community11

Small or concentrated contributor base

Maturity53

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

761d 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

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[roave/backward-compatibility-check

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

5953.3M56](/packages/roave-backward-compatibility-check)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4723.6M20](/packages/coenjacobs-mozart)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[recca0120/laravel-erd

Laravel ERD automatically generates Entity-Relationship Diagrams from your Laravel models and displays them using Vuerd.

36072.0k](/packages/recca0120-laravel-erd)[ondrejmirtes/better-reflection

Better Reflection - an improved code reflection API

136.2M4](/packages/ondrejmirtes-better-reflection)

PHPackages © 2026

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