PHPackages                             klausi/yaml\_comments - 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. klausi/yaml\_comments

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

klausi/yaml\_comments
=====================

YAML parser that also reads/writes comment lines

0.x-dev(9y ago)41.4k↓100%1[1 PRs](https://github.com/klausi/yaml_comments/pulls)GPLv2+PHPPHP &gt;=5.5

Since Mar 12Pushed 8y ago3 watchersCompare

[ Source](https://github.com/klausi/yaml_comments)[ Packagist](https://packagist.org/packages/klausi/yaml_comments)[ Docs](https://github.com/klausi/yaml_comments)[ RSS](/packages/klausi-yaml-comments/feed)WikiDiscussions 0.x Synced today

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

YamlComments
============

[](#yamlcomments)

Parses YAML and provides comments with their line numbers as well as the line number of any given key of the document structure.

The parser was copied and modified from the [Symfony YAML component](http://symfony.com/doc/current/components/yaml.html), MIT license Copyright (c) 2004-2017 Fabien Potencier

Usage
-----

[](#usage)

```
use Klausi\YamlComments\YamlComments;

$exampleYaml =    # Some comment here.
)

```

Get the line number of a particular key:

```
print $parseResult->getLineNumber('name');
1
print $parseResult->getLineNumber('description');
4
print $parseResult->getLineNumber(['dependencies', 3]);
14
```

###  Health Score

26

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

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

3292d ago

### Community

Maintainers

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

---

Top Contributors

[![klausi](https://avatars.githubusercontent.com/u/213229?v=4)](https://github.com/klausi "klausi (23 commits)")

---

Tags

yamlyaml

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[jms/metadata

Class/method/property metadata management in PHP

1.8k150.5M85](/packages/jms-metadata)[nette/neon

🍸 Nette NEON: encodes and decodes NEON file format.

93360.6M305](/packages/nette-neon)[mustangostang/spyc

A simple YAML loader/dumper class for PHP

73239.4M152](/packages/mustangostang-spyc)[hassankhan/config

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

1.0k13.4M157](/packages/hassankhan-config)[spatie/yaml-front-matter

A to the point yaml front matter parser

3421.7M55](/packages/spatie-yaml-front-matter)[pragmarx/yaml

Load your Laravel config files using yaml

1152.7M28](/packages/pragmarx-yaml)

PHPackages © 2026

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