PHPackages                             wafl-lang/php-core - 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. wafl-lang/php-core

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

wafl-lang/php-core
==================

PHP implementation of the WAFL core

00PHP

Since Nov 18Pushed 6mo agoCompare

[ Source](https://github.com/wafl-lang/php-core)[ Packagist](https://packagist.org/packages/wafl-lang/php-core)[ RSS](/packages/wafl-lang-php-core/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

WAFL PHP Core
=============

[](#wafl-php-core)

PHP implementation of the WAFL (Wider Attribute Formatting Language) configuration pipeline. It loads `.wafl` files, resolves imports, evaluates expressions/tags, and validates the result against schemas declared in `@schema` blocks.

Package layout
--------------

[](#package-layout)

FileRole`src/ConfigLoader.php`High-level orchestrator that chains all processing stages`src/Loader.php`Reads files, resolves `@import`, extracts `@schema` / `@eval` blocks`src/Parser.php`Indentation-aware parser that builds the intermediate AST`src/Resolver.php`Resolves `__expr` nodes, conditional lists, and registered tags`src/DocumentEvaluator.php`Runs the final evaluation pass (with `$` symbols support)`src/SchemaValidator.php`Validates the resolved config against schema definitions`src/TagRegistry.php`Built-in tag registry (`!rgb`, `!file`) with extension points`src/TypeMetadataExtractor.php`Captures `key` annotations before resolution`src/Utils.php`Shared helpers (`deepMerge`, associative detection, etc.)Installation
------------

[](#installation)

```
composer require wafl/php-core
```

Usage
-----

[](#usage)

```
use Wafl\Core\ConfigLoader;

$loader = new ConfigLoader();
$result = $loader->load(__DIR__ . '/app.wafl', [
    'env' => $_ENV,
]);

$config = $result['config'];
$meta = $result['meta'];
```

### WAFL file example

[](#wafl-file-example)

```
@schema:
  App:
    name: string
    version: string
    port: int
    debug?: bool
    theme:
      primary: string
      secondary: string
    features: list

app:
  name: "WAFL Demo"
  version: "1.0.0"

  port = $ENV.PORT || 3000
  debug = $ENV.NODE_ENV === "dev"

  theme:
    primary = !rgb(255, 200, 80)
    secondary = "#111"

  features:
    - login
    - analytics
    - if $ENV.NODE_ENV === "dev": monitoring

```

Loading this file with `ConfigLoader` resolves tags/expressions and validates against `schema.wafl`:

```
[
    'app' => [
        'name' => 'WAFL Demo',
        'version' => '1.0.0',
        'port' => 3000,
        'debug' => false,
        'theme' => [
            'primary' => '#ffc850',
            'secondary' => '#111',
        ],
        'features' => ['login', 'analytics'],
    ],
]
```

Setting `NODE_ENV=dev PORT=8080` would flip `debug` to `true`, set `port` to `8080`, and include the `monitoring` feature. `TagRegistry` includes built-ins like `!rgb` and can be extended; `@schema` is optional but enforced when present.

Running tests
-------------

[](#running-tests)

```
composer install
composer test
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance47

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/wafl-lang-php-core/health.svg)

```
[![Health](https://phpackages.com/badges/wafl-lang-php-core/health.svg)](https://phpackages.com/packages/wafl-lang-php-core)
```

###  Alternatives

[yannisme/cntheme

FlarumCN Theme For Flarum

111.8k](/packages/yannisme-cntheme)

PHPackages © 2026

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