PHPackages                             vmassalov/config - 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. vmassalov/config

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

vmassalov/config
================

Configuration service

v1.0.0-alpha(2y ago)00MITPHPPHP &gt;=8.2

Since Feb 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/vmassalov/config)[ Packagist](https://packagist.org/packages/vmassalov/config)[ RSS](/packages/vmassalov-config/feed)WikiDiscussions main Synced today

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

Config
======

[](#config)

Library for matching rulesets based on file configs

The main goal of this package is to move out endless sequences of business logic 'elseif' outside of the code. It can be mapping exception classes to error codes, discount calculation rules, or any other strategy conditions. All conditions that do not change often enough and are not worth putting in the database can be conveniently transferred to the configs.

Install
-------

[](#install)

Via composer

```
composer require vmassalov/config
```

Quick usage
-----------

[](#quick-usage)

Create yaml config file, e.g.:

```
- conditions:
    dayOfWeek:
      - monday
      - tuesday
      - wednesday
      - thursday
      - friday
    projectPriority:
      - normal
      - minor
  result:
    salaryRate: 1
    needOvertimeApprove: true

- conditions:
    dayOfWeek:
      - monday
      - tuesday
      - wednesday
      - thursday
      - friday
    projectPriority: critical
  result:
    salaryRate: 1
    needOvertimeApprove: false

- conditions:
    projectPriority: critical
  result:
    salaryRate: 2
    needOvertimeApprove: false
```

All result blocks should contain same keys. All condition block can contain a different keys with single or multiple options.

```
$configClient = \VMassalov\Config\ClientFactory::build('filesystem://./path/to/configs');
$configClient->find(
    'config.yaml',
    [
        'dayOfWeek' => 'sunday',
        'projectPriority' => 'critical',
    ],
);
```

Client will return a result of first full match item based on passed criteria

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

[](#configuration)

### DSN

[](#dsn)

filesystem://

### Config syntax

[](#config-syntax)

See examples in tests/functional/stubs/yaml/baseConfig.yaml

Test
----

[](#test)

Run unit and functional test in docker

```
make build && make test
```

Run unit and functional test locally

```
php ./vendor/bin/phpunit
```

Roadmap
-------

[](#roadmap)

- Add JSON support
- Add XML support

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

862d ago

### Community

Maintainers

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

---

Top Contributors

[![vmassalov](https://avatars.githubusercontent.com/u/28536499?v=4)](https://github.com/vmassalov "vmassalov (2 commits)")

---

Tags

configyaml

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vmassalov-config/health.svg)

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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