PHPackages                             switon/yaml - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. switon/yaml

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

switon/yaml
===========

Strict Switon YAML subset parsing with placeholder interpolation for Switon Framework

v1.0.0(1mo ago)0313MITPHPPHP &gt;=8.3CI passing

Since Jun 6Pushed 1mo agoCompare

[ Source](https://github.com/switon-php/yaml)[ Packagist](https://packagist.org/packages/switon/yaml)[ Docs](https://github.com/switon-php/yaml)[ RSS](/packages/switon-yaml/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (5)Versions (2)Used By (3)

Switon YAML Package
===================

[](#switon-yaml-package)

[![YAML CI](https://camo.githubusercontent.com/480e8a87890620ce3ac6115436575d60553dc832bfc7ba9de6e7c96377aecec3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737769746f6e2d7068702f79616d6c2f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d59414d4c2532304349)](https://github.com/switon-php/yaml/actions/workflows/ci.yml) [![PHP 8.3+](https://camo.githubusercontent.com/c03f51341eebaefabbf137e291b20523fc74b4ffd084406d88524d266d95085d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d373737424234)](https://www.php.net/)

Switon's strict YAML subset parser and placeholder resolver for predictable config documents.

Highlights
----------

[](#highlights)

- **Strict YAML subset:** only the supported Switon YAML features are parsed.
- **Single-step read:** YAML can be parsed and interpolated at once.
- **Predictable failures:** parse errors are reported clearly.
- **Config-friendly output:** the result is a plain PHP array for config loading.

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

[](#installation)

```
composer require switon/yaml
```

Quick Start
-----------

[](#quick-start)

```
use Switon\Core\Attribute\Autowired;
use Switon\Yaml\YamlReaderInterface;

class ConfigService
{
    #[Autowired] protected YamlReaderInterface $yamlReader;

    public function load(string $yaml): array
    {
        return $this->yamlReader->read($yaml, ['APP_ENV' => 'prod']);
    }
}
```

Docs:

License
-------

[](#license)

MIT.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance90

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

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

48d ago

### Community

Maintainers

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

---

Top Contributors

[![switon-php](https://avatars.githubusercontent.com/u/247358032?v=4)](https://github.com/switon-php "switon-php (1 commits)")

---

Tags

configswitonyamlymlconfigparseryamlswiton

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/switon-yaml/health.svg)

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

###  Alternatives

[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

1.0k13.8M189](/packages/hassankhan-config)[pragmarx/yaml

Load your Laravel config files using yaml

1152.8M30](/packages/pragmarx-yaml)[laktak/hjson

JSON for Humans. A configuration file format with relaxed syntax, fewer mistakes and more comments.

86245.3k14](/packages/laktak-hjson)[dallgoot/yaml

Provides loader, dumper and an API for YAML content. Loader builds to equivalent data types in PHP 8.x

43255.2k9](/packages/dallgoot-yaml)[romanpitak/nginx-config-processor

Nginx configuration files processor.

6935.9k1](/packages/romanpitak-nginx-config-processor)[thewunder/conphigure

Framework Agnostic Configuration Library

3120.6k](/packages/thewunder-conphigure)

PHPackages © 2026

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