PHPackages                             ju1ius/luigi - 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. ju1ius/luigi

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

ju1ius/luigi
============

Need to generate PHP code? Luigi does the plumbing!

1.0(3y ago)11.7k3MITPHPPHP &gt;=8.1

Since Feb 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ju1ius/luigi)[ Packagist](https://packagist.org/packages/ju1ius/luigi)[ RSS](/packages/ju1ius-luigi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (3)

ju1ius/luigi
============

[](#ju1iusluigi)

[![codecov](https://camo.githubusercontent.com/6b8768e5843017345ec6f27712f2dcae82a936dca2179e1e41de6bbece6c530e/68747470733a2f2f636f6465636f762e696f2f67682f6a75316975732f6c756967692f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d30474e324a5056304457)](https://codecov.io/gh/ju1ius/luigi)

Need to generate PHP code? Luigi does the plumbing!

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

[](#installation)

```
composer require ju1ius/luigi
```

Basic usage
-----------

[](#basic-usage)

```
use ju1ius\Luigi\CodeBuilder;

$code = CodeBuilder::create();
// The `raw` method adds verbatim code
$code->raw("return [\n");
// The `indent` method increases the indent level
$code->indent();
// The `write` does the same as `raw` but respects the indent level
$code->write("42,\n");
// The `writeln` method does the same as `write`, but adds a newline character after each argument.
$code->writeln('33,', '66,');
// The `dedent` method decreases the indent level
$code->dedent();
$code->writeln('];');
// CodeBuilder implements the `Stringable` interface
echo $code;
```

This is the expected output:

```
return [
    42,
    33,
    66,
];
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

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

1198d ago

### Community

Maintainers

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

---

Top Contributors

[![ju1ius](https://avatars.githubusercontent.com/u/218404?v=4)](https://github.com/ju1ius "ju1ius (3 commits)")

---

Tags

code-buildercode-generationcodegencompiler-toolcode-generationcode-builder

### Embed Badge

![Health badge](/badges/ju1ius-luigi/health.svg)

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

###  Alternatives

[jms/cg

Toolset for generating PHP code

15615.8M8](/packages/jms-cg)[gossi/php-code-generator

Toolset for generating PHP code

148203.9k32](/packages/gossi-php-code-generator)

PHPackages © 2026

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