PHPackages                             kyos/configparser - 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. kyos/configparser

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

kyos/configparser
=================

A simple YAML config file loader.

3.0.0(4y ago)0182.5k↓33.3%MITPHPPHP ^8.0

Since Nov 26Pushed 4y ago8 watchersCompare

[ Source](https://github.com/kyosenergy/configparser)[ Packagist](https://packagist.org/packages/kyos/configparser)[ Docs](https://github.com/kyos/configparser)[ RSS](/packages/kyos-configparser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (10)Used By (0)

[![banner](.github/banner.png)](.github/banner.png)

configparser
============

[](#configparser)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6c84c002036535cc8260e989cc8f732036050cb08ac3839b5574b51efb019f76/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b796f732f636f6e6669677061727365722e737667)](https://packagist.org/packages/kyos/configparser)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![CI](https://github.com/kyosenergy/configparser/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/kyosenergy/configparser/workflows/CI/badge.svg?branch=master&event=push)[![Coverage Status](https://camo.githubusercontent.com/7d479a046461f2ad661c054df63647b552e70db6c2db89ad99a9c3ab201b16de/68747470733a2f2f636f6465636f762e696f2f67682f6b796f73656e657267792f636f6e6669677061727365722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/kyosenergy/configparser)[![Total Downloads](https://camo.githubusercontent.com/b56ab06e37eb12ac42b2708f4a861a8539911c5caa2930b922ba1474a1dd82c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b796f732f636f6e6669677061727365722e737667)](https://packagist.org/packages/kyos/configparser)

A simple YAML config file loader.

Install
-------

[](#install)

Via Composer

```
$ composer require kyos/configparser
```

Usage
-----

[](#usage)

Given the following `config.yaml` configuration file:

```
application:
  releaseStage: Production
  debugMode: true
```

you can parse any of its properties using:

```
$parser = Kyos\ConfigParser::getParserForFile('config.yaml');
echo $parser->get('application.releaseStage');
```

You can use the following notations:

1. **Dot notation**:

```
echo $parser->get('application.releaseStage');
```

2. **Array notation**:

```
echo $parser->get(['application', 'releaseStage']);
```

3. **String notation** (for top level keys):

```
var_dump($parser->get('application'));
```

Assertions
----------

[](#assertions)

Using ConfigParser, you can require specific keys to be defined and their types. Note: All commands should be proceeded by an evaluate function call.

### Required Key

[](#required-key)

```
echo $parser->evaluate('application.releaseStage')->isRequired();
```

### String

[](#string)

```
echo $parser->evaluate('application.releaseStage')->isString();
```

### Numeric

[](#numeric)

```
echo $parser->evaluate('application.releaseStage')->isNumeric();
```

### Boolean

[](#boolean)

```
echo $parser->evaluate('application.releaseStage')->isBoolean();
```

### Array

[](#array)

```
echo $parser->evaluate('application')->isArray();
```

### Allowed Values

[](#allowed-values)

```
echo $parser->evaluate('application.releaseStage')->isOneOf(['Production', 'Staging', 'Test']);
```

### Chain

[](#chain)

Assertion functions can be also chained.

```
echo $parser->evaluate('application.releaseStage')
            ->isRequired()->isString()
            ->isOneOf(['Production', 'Staging', 'Test']);
```

Change log
----------

[](#change-log)

Please see [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Zois Pagoulatos](https://github.com/zoispag)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 78.4% 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 ~152 days

Recently: every ~304 days

Total

9

Last Release

1513d ago

Major Versions

1.0.4 → 2.0.02019-03-15

2.1.0 → 3.0.02022-03-27

PHP version history (2 changes)1.0.0PHP &gt;=7.1.0

3.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/43083753eb866efcb3659e35be62f307b216189a99dfa7db2beb306bbfb88cba?d=identicon)[kyos](/maintainers/kyos)

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

---

Top Contributors

[![zoispag](https://avatars.githubusercontent.com/u/21138205?v=4)](https://github.com/zoispag "zoispag (29 commits)")[![mitchdesign](https://avatars.githubusercontent.com/u/497806?v=4)](https://github.com/mitchdesign "mitchdesign (8 commits)")

---

Tags

configpackagepackagistphpyamlyamlkyosconfigparseryamlconfig

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kyos-configparser/health.svg)

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

###  Alternatives

[spatie/yaml-front-matter

A to the point yaml front matter parser

3411.8M68](/packages/spatie-yaml-front-matter)[pragmarx/yaml

Load your Laravel config files using yaml

1152.8M29](/packages/pragmarx-yaml)[sspooky13/yaml-standards

Standards for yaml files

11518.3k3](/packages/sspooky13-yaml-standards)[thunderer/serializard

Flexible serializer

2767.3k1](/packages/thunderer-serializard)[mhujer/yaml-sort-checker

YAML sort checker checks if your YML files are properly sorted to prevent merge conflicts

2361.6k](/packages/mhujer-yaml-sort-checker)[pagerange/metaparsedown

Adds ability to have meta data in markdown files parsed by eursev/parsedown or eruseve/parsedown-extra

2637.2k2](/packages/pagerange-metaparsedown)

PHPackages © 2026

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