PHPackages                             avastechnology/demeter - 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. avastechnology/demeter

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

avastechnology/demeter
======================

OOP approach for structural code generation.

1.1.1(6mo ago)064↑650%MITPHPPHP ^8.4

Since Dec 31Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/AVASTechnology/demeter)[ Packagist](https://packagist.org/packages/avastechnology/demeter)[ RSS](/packages/avastechnology-demeter/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (2)Versions (14)Used By (0)

Demeter
=======

[](#demeter)

[![PHP Version Require](https://camo.githubusercontent.com/7fb7ca689a132c7623e23a3554a0102aa5325a9622b3b3706ba03edded9e25ee/687474703a2f2f706f7365722e707567782e6f72672f61766173746563686e6f6c6f67792f64656d657465722f726571756972652f706870)](https://packagist.org/packages/avastechnology/demeter)[![Latest Release](https://camo.githubusercontent.com/b139b6d0f98501b4103197faf94456238f92cf71867b8b53d818d5aef98d77a7/687474703a2f2f706f7365722e707567782e6f72672f61766173746563686e6f6c6f67792f64656d657465722f76)](https://packagist.org/packages/avastechnology/demeter)[![License](https://camo.githubusercontent.com/be40dc92084f08b1251faf22f86c999c513d57c4eadd93d2336d465d22af6d14/687474703a2f2f706f7365722e707567782e6f72672f61766173746563686e6f6c6f67792f64656d657465722f6c6963656e7365)](https://packagist.org/packages/avastechnology/demeter)

**Demeter is OOP approach for structural code generation.**

The Demeter library provides an Object-Oriented approach to building the structural units required for code generation. The goal is to make it easy to generate/modify source code.

Since this library is built primarily for developer tasks, it really should not be used on production sites, rather it should be included as part of the development package set.

**This is a work in progress and only feature complete as has been needed!**

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

[](#installation)

Include this library:

```
~ composer require avastechnology/demeter --dev
```

CSS
---

[](#css)

### Parse a CSS file into components

[](#parse-a-css-file-into-components)

```
use AVASTech\Demeter\CSS\Parser;

$parser = new Parser();

$styleSheet = $parser->parse(file_get_contents(__DIR__ . '/test.css'));
```

### Reformat a CSS file into a pretty-print version

[](#reformat-a-css-file-into-a-pretty-print-version)

```
use AVASTech\Demeter\CSS\Parser;
use AVASTech\Demeter\CSS\Formats\Factory;

$parser = new Parser();

$styleSheet = $parser->parse(file_get_contents(__DIR__ . '/compact.css'));

file_put_contents(
  __DIR__ . '/pretty.css',
  $styleSheet->render((new Factory())->compactStyleSheet())
);
```

### Reformat a CSS file into a compact version

[](#reformat-a-css-file-into-a-compact-version)

```
use AVASTech\Demeter\CSS\Parser;
use AVASTech\Demeter\CSS\Formats\Factory;

$parser = new Parser();

$styleSheet = $parser->parse(file_get_contents(__DIR__ . '/pretty.css'));

file_put_contents(
  __DIR__ . '/compact.css',
  $styleSheet->render((new Factory())->compactStyleSheet())
);
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance68

Regular maintenance activity

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 94.1% 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 ~43 days

Recently: every ~1 days

Total

7

Last Release

189d ago

Major Versions

0.1.0 → v1.0.0.x-dev2025-09-13

PHP version history (2 changes)0.1.0PHP ^8.3

v1.0.0.x-devPHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b59cc708a3ea88f3d7eae5f5d51e4b3cd26984a71ae5bfbf2b0a3827aa0699d?d=identicon)[avastech](/maintainers/avastech)

---

Top Contributors

[![ahgreen](https://avatars.githubusercontent.com/u/5686621?v=4)](https://github.com/ahgreen "ahgreen (16 commits)")[![avastech](https://avatars.githubusercontent.com/u/23587318?v=4)](https://github.com/avastech "avastech (1 commits)")

---

Tags

Code styleformattinggeneration

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/avastechnology-demeter/health.svg)

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

###  Alternatives

[marcocesarato/php-conventional-changelog

Generate changelogs and release notes from a project's commit messages and metadata and automate versioning with semver.org and conventionalcommits.org

2511.3M99](/packages/marcocesarato-php-conventional-changelog)[typo3/coding-standards

A set of coding guidelines for any TYPO3-related project or extension

662.8M313](/packages/typo3-coding-standards)[jubeki/laravel-code-style

Combine Custom Fixers with the ruleset of Laravel Pint to fix your code style in Laravel Applications/Packages.

56506.2k6](/packages/jubeki-laravel-code-style)[nlgen/nlgen

A library for creating recursive-descent natural language generators.

56174.2k](/packages/nlgen-nlgen)[mnito/round-robin

Round-robin schedule generation implementation in PHP

6168.3k](/packages/mnito-round-robin)[shopsys/coding-standards

Coding standards definition compatible with PSR-2

20264.4k10](/packages/shopsys-coding-standards)

PHPackages © 2026

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