PHPackages                             lanfisis/deflection - 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. lanfisis/deflection

ActiveLibrary

lanfisis/deflection
===================

A library to generate php class for file or display

1.0.0(10y ago)0301[1 PRs](https://github.com/lanfisis/deflection/pulls)1WTFPLPHPPHP &gt;=5.4.0

Since Oct 1Pushed 8y ago1 watchersCompare

[ Source](https://github.com/lanfisis/deflection)[ Packagist](https://packagist.org/packages/lanfisis/deflection)[ Docs](https://github.com/lanfisis/deflection)[ RSS](/packages/lanfisis-deflection/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (1)

A library to generate php class for file or display

How it works
============

[](#how-it-works)

There's two different ways to use this library:

- use element model to build your final class
- use an array and the Transformer model

The model style way
-------------------

[](#the-model-style-way)

Soon

The array style way
-------------------

[](#the-array-style-way)

```
$transformer = new Deflection\Transformer();
$class = $transformer->arrayToClassElement(array(
    'docblock' => array(
        'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
        'infos'       => array (
            'category'  => 'Deflection',
            'author'    => 'David Buros ',
            'copyright' => '2014 David Buros',
            'licence'   => 'WTFPL see LICENCE.md file',
        ),
    ),
   'namespace' => 'Deflection',
   'uses'      => array (
       'Deflection\Element\Classes',
       'Deflection\Element\Docblock',
       'Method' => 'Deflection\Element\Functions',
    ),
    'name'       => 'Generator',
    'extends'    => 'GeneratorAbstract',
    'implements' => array(
        'ExtractorInterface',
        'LimitIterator',
    ),
    'functions' => array(
        array(
            'public'  => true,
            'name'    => 'arrayToClassElement',
            'docblock' => array(
                'description' => 'Lorem ipsum dolor sit amet',
                'params'      => array (
                    'definition' => array(
                        'type'        => 'array',
                        'description' => 'Lorem ipsum',
                    ),
                    'is_active' => array(
                        'type'        => 'boolean',
                        'description' => 'Lorem ipsum',
                    ),
                ),
                'return' => 'Deflection/Element/Functions',
            ),
            'params' => array(
                'definition' => 'array',
                'is_active'  => null,

            ),
            'content' => array(
                'if (1 == 1) {',
                array('return new Method();'),
                '}',
            ),
        ),
    ),
));

$generator = new Deflection\Generator($class);
echo($generator->asString());
```

The result
----------

[](#the-result)

```
/**
 * Lorem ipsum dolor sit amet, consectetur adipiscing elit
 *
 * @category  Deflection
 * @author    David Buros
 * @copyright 2014 David Buros
 * @licence   WTFPL see LICENCE.md file
 */

namespace Deflection;

use Deflection\Element\Classes;
use Deflection\Element\Docblock;
use Deflection\Element\Functions as Method;

class Generator
    extends GeneratorAbstract
    implements ExtractorInterface, LimitIterator
{

    /**
     * Lorem ipsum dolor sit amet
     *
     * @var array   $definition Lorem ipsum
     * @var boolean $is_active  Lorem ipsum
     *
     * @return Deflection/Element/Functions
     */
    public function arrayToClassElement(array $definition, $is_active)
    {
        if (1 == 1) {
            return new Method();
        }
    }
}
```

Licence
=======

[](#licence)

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Read term on LICENCE.md file

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3879d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3505f6ef263882c7be77a72e76e675c69c9af9184bcd6469a87786a0c75e87a8?d=identicon)[lanfisis](/maintainers/lanfisis)

---

Top Contributors

[![lanfisis](https://avatars.githubusercontent.com/u/872996?v=4)](https://github.com/lanfisis "lanfisis (5 commits)")

---

Tags

generator

### Embed Badge

![Health badge](/badges/lanfisis-deflection/health.svg)

```
[![Health](https://phpackages.com/badges/lanfisis-deflection/health.svg)](https://phpackages.com/packages/lanfisis-deflection)
```

###  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)[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

2.9k27.6M92](/packages/simplesoftwareio-simple-qrcode)[phpowermove/docblock

PHP Docblock parser and generator. An API to read and write Docblocks.

2524.0M4](/packages/phpowermove-docblock)

PHPackages © 2026

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