PHPackages                             prometee/php-class-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. prometee/php-class-generator

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

prometee/php-class-generator
============================

PHP class generator

v1.0.15(2mo ago)28.6k↑200%3MITPHPCI passing

Since Jun 19Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Prometee/PhpClassGenerator)[ Packagist](https://packagist.org/packages/prometee/php-class-generator)[ RSS](/packages/prometee-php-class-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (17)Used By (3)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f0a582d2a6e9711db689b7b716146fdf86052c2c1c7ed3420e9401c20e4d84a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f50726f6d657465652f7068702d636c6173732d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/prometee/php-class-generator)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://github.com/Prometee/PhpClassGenerator/workflows/Build/badge.svg)](https://github.com/Prometee/PhpClassGenerator/actions?query=workflow%3A%22Build%22)

PHP8 class generator
--------------------

[](#php8-class-generator)

This library generate PHP8 classes.

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

[](#installation)

Install using Composer :

```
$ composer require prometee/php-class-generator

```

Usage
-----

[](#usage)

Create your `PhpGenerator`, an example can be found here :

[DummyPhpGenerator.php](tests/DummyPhpGenerator.php)

Then instantiate :

```
$loader = require_once( __DIR__.'/vendor/autoload.php');

use Doctrine\Common\Annotations\Annotation\Required;
use Prometee\PhpClassGenerator\Builder\ClassBuilder;
use Prometee\PhpClassGenerator\Builder\Model\ModelFactoryBuilder;
use Prometee\PhpClassGenerator\Builder\View\ViewFactoryBuilder;
use Prometee\PhpClassGenerator\Model\PhpDoc\PhpDocInterface;

// Create your own Php Generator
final class MyPhpGenerator implements PhpGeneratorInterface {
    use PhpGeneratorTrait;
}

$path = __DIR__ . '/etc/build/Dummy';
$namespace = 'Tests\\Prometee\\PhpClassGenerator\\Resources';
$classConfig = [
    [
        'class' => 'MyClass',
        'type' => 'final',
        'extends' => stdClass::class,
        'phpdoc' => [
            PhpDocInterface::TYPE_DESCRIPTION => [
                'My own class description',
                'with multiple lines',
            ],
        ],
        'properties' => [
            [
                'name' => 'myProperty',
                'types' => [
                    'null',
                    $namespace . '\\MyClass[]',
                ],
                'default' => null,
                'description' => null,
                'phpdoc' => [
                    PhpDocInterface::TYPE_DESCRIPTION => [
                        'My description',
                        'My description line 2',
                    ],
                    sprintf('\\%s()', Required::class) => [''] // An annotation
                ],
            ],
        ],
    ],
];

$dummyPhpGenerator = new MyPhpGenerator(
    new ClassBuilder(
        new ModelFactoryBuilder(),
        new ViewFactoryBuilder()
    )
);

// Configure the generator first
$dummyPhpGenerator->configure(
    $path,
    $namespace,
    $classConfig
);

// Then generate
$dummyPhpGenerator->generate();
```

Results example
---------------

[](#results-example)

[tests/Resources](tests/Resources)

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance85

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Recently: every ~162 days

Total

16

Last Release

78d ago

PHP version history (2 changes)v1.0.0PHP ^7.3

v1.0.5PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/970e9207938e33441b0b7e3207c46b4df8ed7f020c77e40793812405ae8b0a3b?d=identicon)[Prometee](/maintainers/Prometee)

---

Top Contributors

[![Prometee](https://avatars.githubusercontent.com/u/861820?v=4)](https://github.com/Prometee "Prometee (103 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/prometee-php-class-generator/health.svg)

```
[![Health](https://phpackages.com/badges/prometee-php-class-generator/health.svg)](https://phpackages.com/packages/prometee-php-class-generator)
```

###  Alternatives

[phing/phing

PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.

1.2k21.7M876](/packages/phing-phing)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[flow-php/etl

PHP ETL - Extract Transform Load - Abstraction

374468.4k51](/packages/flow-php-etl)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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