PHPackages                             wearegenuine/gnorm-twig - 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. [Templating &amp; Views](/categories/templating)
4. /
5. wearegenuine/gnorm-twig

ActiveLibrary[Templating &amp; Views](/categories/templating)

wearegenuine/gnorm-twig
=======================

Supplemental library for compiling Gnorm Twig files.

v4.0.0(1y ago)246.2k↓12.5%1[349 issues](https://github.com/GAI-DXA/gnorm-twig/issues)MITPHPPHP ^7.4 || ^8.0

Since Apr 24Pushed 1y ago3 watchersCompare

[ Source](https://github.com/GAI-DXA/gnorm-twig)[ Packagist](https://packagist.org/packages/wearegenuine/gnorm-twig)[ RSS](/packages/wearegenuine-gnorm-twig/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (6)Dependencies (7)Versions (27)Used By (0)

Gnorm Twig
==========

[](#gnorm-twig)

Implements the Twig functionality used by [Genuine's Gnorm framework](https://github.com/GAI-DXA/gnorm-twig).

Overview
--------

[](#overview)

Gnorm Twig is a supplemental library for compiling Gnorm Twig files, providing various Twig filter implementations and a compiler script.

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

[](#installation)

To install the project, clone the repository and run the following command to install dependencies:

```
composer install
```

Dependencies
------------

[](#dependencies)

The project requires the following:

- PHP: ^7.4 || ^8.0
- ext-json: \*
- twig/twig: ^2.15.3 || ^3.5.0

For development:

- phpcompatibility/php-compatibility: ^9.3
- phpstan/phpstan: ^1.9
- squizlabs/php\_codesniffer: ^3.6
- phpunit/phpunit: ^9.5

Configuration
-------------

[](#configuration)

The project uses several configuration files:

- `.ddev/config.yaml`: Configuration for the development environment.
- `composer.json`: Lists project dependencies and autoloading information.
- `phpcs.xml.dist`: Configuration for PHP CodeSniffer.
- `phpstan.neon.dist`: Configuration for PHPStan.
- `phpunit.xml.dist`: Configuration for PHPUnit.

Usage
-----

[](#usage)

To compile Twig files, use the `bin/compile.php` script. It requires a JSON-encoded configuration and a build flag:

```
php bin/compile.php -c  -b
```

Development
-----------

[](#development)

### Coding Standards

[](#coding-standards)

The project follows PSR-12 coding standards. Use PHP CodeSniffer to check for compliance:

```
vendor/bin/phpcs
```

### Static Analysis

[](#static-analysis)

Use PHPStan for static analysis:

```
vendor/bin/phpstan analyse
```

### Testing

[](#testing)

The project uses PHPUnit for unit testing. To run the tests, use the following command:

```
vendor/bin/phpunit
```

Test files are located in the `tests` directory and follow the naming convention `*Test.php`.

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

[](#contributing)

Contributions are welcome! Please follow the coding standards, ensure all tests pass, and add new tests for new functionality before submitting a pull request.

Additional Information
----------------------

[](#additional-information)

- The `GnormCompiler` class implements the `CompilerInterface` and is responsible for compiling Twig files. It uses the `GnormTwigConfiguration` class to decode JSON configurations.
- The `FedExtensions` and `Drupal` classes provide custom Twig extensions, filters, and functions.
- The `FileSystemTraversal` class provides methods to traverse the file system to find specific directories or files.
- The `.gitignore` file includes common directories and files to be ignored, such as `/vendor`, `/node_modules`, and log files.
- Unit tests have been added to ensure the reliability and correctness of the codebase.

For more detailed information on each component, refer to the respective source files in the `src` directory and test files in the `tests` directory.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity75

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

Total

20

Last Release

638d ago

Major Versions

v0.4.5 → v2.0.0-alpha12023-01-10

v2.0.2 → v3.0.02023-10-18

v3.1.0 → v4.0.02024-10-04

PHP version history (3 changes)v0.1.0-alphaPHP ^7.0

v0.4.3PHP &gt;=7.4

v0.4.5PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2963795?v=4)[pconnors](/maintainers/pconnors)[@pconnors](https://github.com/pconnors)

![](https://avatars.githubusercontent.com/u/1358953?v=4)[Ryan Brooks](/maintainers/ryanobrooks)[@ryanobrooks](https://github.com/ryanobrooks)

![](https://avatars.githubusercontent.com/u/3648379?v=4)[Chase Barrett](/maintainers/pixelcab)[@pixelcab](https://github.com/pixelcab)

---

Top Contributors

[![pixelcab](https://avatars.githubusercontent.com/u/3648379?v=4)](https://github.com/pixelcab "pixelcab (32 commits)")[![lpeabody](https://avatars.githubusercontent.com/u/419534?v=4)](https://github.com/lpeabody "lpeabody (19 commits)")[![lpeabodygenuine](https://avatars.githubusercontent.com/u/91211859?v=4)](https://github.com/lpeabodygenuine "lpeabodygenuine (6 commits)")[![pjconnors](https://avatars.githubusercontent.com/u/3886376?v=4)](https://github.com/pjconnors "pjconnors (6 commits)")[![ian-rose](https://avatars.githubusercontent.com/u/3975428?v=4)](https://github.com/ian-rose "ian-rose (2 commits)")[![ryanobrooks](https://avatars.githubusercontent.com/u/1358953?v=4)](https://github.com/ryanobrooks "ryanobrooks (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wearegenuine-gnorm-twig/health.svg)

```
[![Health](https://phpackages.com/badges/wearegenuine-gnorm-twig/health.svg)](https://phpackages.com/packages/wearegenuine-gnorm-twig)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[mati365/ckeditor5-symfony

CKEditor 5 integration for Symfony

262.6k](/packages/mati365-ckeditor5-symfony)

PHPackages © 2026

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