PHPackages                             susina/psr2-code-generator - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. susina/psr2-code-generator

AbandonedArchivedLibrary[PSR &amp; Standards](/categories/psr-standards)

susina/psr2-code-generator
==========================

Toolset for generating PHP code following PSR-2 standard

v3.3(5y ago)4221[3 issues](https://github.com/susina/psr2-code-generator/issues)Apache-2.0PHPPHP &gt;=7.2

Since Feb 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/susina/psr2-code-generator)[ Packagist](https://packagist.org/packages/susina/psr2-code-generator)[ RSS](/packages/susina-psr2-code-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (12)Used By (0)

PSR-2 Code Generator
====================

[](#psr-2-code-generator)

[![](https://github.com/susina/psr2-code-generator/workflows/Tests/badge.svg)](https://github.com/susina/psr2-code-generator/workflows/Tests/badge.svg)[![](https://github.com/susina/psr2-code-generator/workflows/Build%20and%20deploy%20documentation/badge.svg)](https://github.com/susina/psr2-code-generator/workflows/Build%20and%20deploy%20documentation/badge.svg)[![License](https://camo.githubusercontent.com/a549a7a30bacba7bfceebdc207a8e86c3f2c02995a2527640dca30048fd2b64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d417061636865253230322e302d626c75652e737667)](https://opensource.org/licenses/Apache-2.0)[![Maintainability](https://camo.githubusercontent.com/a8cba5c5bbbec38d58211dead871e34cc311d7b05342ed50e87c40b4dfca8a49/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33613430643238663632653163656465653062652f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/susina/psr2-code-generator/maintainability)[![Test Coverage](https://camo.githubusercontent.com/272d94bf9dcf3d79750ed92ea78c8b67a21baaf1427814a95f3473001263dbdd/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33613430643238663632653163656465653062652f746573745f636f766572616765)](https://codeclimate.com/github/susina/psr2-code-generator/test_coverage)

Psr2-code-generator is a library to generate PHP code programmatically, via a nice fluent api. This library is a light version of the awesome , refactored to generate PSR-2 code.

Differences and restrictions from the original library:

- php 7.2+ strictly typed
- generate PSR-2 code **ONLY**
- generate only php 7.1+ code (strict types)
- possibility to generate typed class properties (php 7.4)
- no reflection nor reverse engeneering
- generate only classes (no standalone functions)

Installation
------------

[](#installation)

Install via Composer:

```
composer require susina/psr2-code-generator

```

Documentation
-------------

[](#documentation)

Documentation is available at

Contributing
------------

[](#contributing)

Feel free to fork and submit a pull request. Don't forget the tests and PSR-2 standard, of course. See the [contributing guide](https://susina.github.io/psr2-code-generator/contributing/) for further information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance5

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~104 days

Recently: every ~64 days

Total

11

Last Release

1964d ago

Major Versions

v1.0 → 2.0.02019-06-03

2.1.1 → v3.02020-04-08

PHP version history (2 changes)v1.0PHP &gt;=5.6

2.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb5ce96caf1e78aeefa09e75b49f21cc5214729ac6a9a06b852cf5de1269e058?d=identicon)[cristianoc72](/maintainers/cristianoc72)

---

Top Contributors

[![gossi](https://avatars.githubusercontent.com/u/283700?v=4)](https://github.com/gossi "gossi (79 commits)")[![schmittjoh](https://avatars.githubusercontent.com/u/197017?v=4)](https://github.com/schmittjoh "schmittjoh (49 commits)")[![cristianoc72](https://avatars.githubusercontent.com/u/865437?v=4)](https://github.com/cristianoc72 "cristianoc72 (47 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (3 commits)")[![nmpolo](https://avatars.githubusercontent.com/u/1206982?v=4)](https://github.com/nmpolo "nmpolo (2 commits)")[![marcj](https://avatars.githubusercontent.com/u/450980?v=4)](https://github.com/marcj "marcj (1 commits)")[![pulzarraider](https://avatars.githubusercontent.com/u/960844?v=4)](https://github.com/pulzarraider "pulzarraider (1 commits)")[![RobinGeuze](https://avatars.githubusercontent.com/u/8234736?v=4)](https://github.com/RobinGeuze "RobinGeuze (1 commits)")[![hhashimoto](https://avatars.githubusercontent.com/u/1752906?v=4)](https://github.com/hhashimoto "hhashimoto (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (1 commits)")[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (1 commits)")

---

Tags

PSR-2code-generation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/susina-psr2-code-generator/health.svg)

```
[![Health](https://phpackages.com/badges/susina-psr2-code-generator/health.svg)](https://phpackages.com/packages/susina-psr2-code-generator)
```

###  Alternatives

[phpdocumentor/type-resolver

A PSR-5 based resolver of Class names, Types and Structural Element Names

9.2k719.5M166](/packages/phpdocumentor-type-resolver)[icamys/php-sitemap-generator

Simple PHP sitemap generator.

175342.8k6](/packages/icamys-php-sitemap-generator)[genert/bbcode

BBCode parser from or to HTML.

81324.0k1](/packages/genert-bbcode)[gossi/php-code-generator

Toolset for generating PHP code

148203.9k32](/packages/gossi-php-code-generator)[php-soap/ext-soap-engine

An ext-soap engine implementation

443.2M7](/packages/php-soap-ext-soap-engine)

PHPackages © 2026

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