PHPackages                             vaened/dictionary-flow - 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. vaened/dictionary-flow

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

vaened/dictionary-flow
======================

A library for comprehensive evaluations within a key-value data dictionary, enabling precise condition definitions and data-driven decision-making.

v3.0.1(1y ago)1126.7k↓15.8%MITPHPPHP ^8.1

Since Aug 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/vaened/dictionary-flow)[ Packagist](https://packagist.org/packages/vaened/dictionary-flow)[ RSS](/packages/vaened-dictionary-flow/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (9)Used By (0)

Dictionary Flow
===============

[](#dictionary-flow)

[![Tests](https://github.com/vaened/dictionary-parser/actions/workflows/tests.yml/badge.svg)](https://github.com/vaened/dictionary-parser/actions/workflows/tests.yml) [![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](license)

The **Dictionary Flow** library is designed to streamline decision-making and action handling based on key-value data dictionaries. It aims to simplify the process by removing the need for repetitive conditions and checks, offering a more structured and flexible approach to managing parameters and executing actions.

By using this tool, you can easily define rules to process data and perform corresponding actions, reducing the reliance on multiple if statements and manual validations. This results in improved code readability and maintainability, making it easier to integrate with systems that handle dynamic data.

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

[](#installation)

You can install the library using composer.

```
composer require vaened/dictionary-flow
```

Usage
-----

[](#usage)

```
$mediator = new Mediator($parameters);

// Utilize reflection to dynamically evaluate the data dictionary
// based on the specified function signature.
$mediator->on(
    Matches::signature(
        fn(array $skills) => /* Perform appropriate action for skills */
    )
);

// Manually check if the 'birthdate' key has a value and process
// it accordingly.
$mediator->on(
    Has::value(
        Input::date('birthdate'),
        fn(DateTimeInterface $birthdate) => /* Perform relevant action based on birthdate */
    )
);
```

### Initialize

[](#initialize)

To start utilizing the library, follow these steps to set up the essential components:

```
// Define your input data as an associative array.
$dictionary = [
    'name' => 'You',
    'birthdate' => '1996-01-01',
    'married' => false,
    'skills' => ['PHP', 'Js', 'Python']
];

// Create a Parameters instance from the defined dictionary.
$parameters = Parameters::from($dictionary);

// Initialize the Mediator using the prepared Parameters instance.
$mediator = new Mediator($parameters);
```

Features

• **Code Simplification**: Replaces numerous if checks with a clear, declarative structure for managing conditions and actions.

• **Flexible Evaluation**: Allows for defining rules and actions for various data types and scenarios through a simple and extensible interface.

• **Structured Data Handling**: Facilitates parameter processing based on a key-value dictionary, organizing logic more efficiently.

• **Seamless Integration**: Easily integrates into applications, enabling quick and straightforward configuration.

• **Extensibility**: Allows developers to create their own rule and condition implementations to fit specific needs.

License
-------

[](#license)

This library is licensed under the MIT License. For more information, please see the [`license`](./license) file.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance40

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Every ~69 days

Recently: every ~27 days

Total

8

Last Release

507d ago

Major Versions

v0.3 → v1.02024-09-10

v1.1 → v2.02024-09-10

v2.0 → v3.02024-12-28

### Community

Maintainers

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

---

Top Contributors

[![vaened](https://avatars.githubusercontent.com/u/15077850?v=4)](https://github.com/vaened "vaened (39 commits)")

---

Tags

data-analysisdecision-supportkey-valueparserKey valuedata-analysisEvaluationdata-dictionarydecision-making

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vaened-dictionary-flow/health.svg)

```
[![Health](https://phpackages.com/badges/vaened-dictionary-flow/health.svg)](https://phpackages.com/packages/vaened-dictionary-flow)
```

###  Alternatives

[nikic/php-parser

A PHP parser written in PHP

17.4k902.6M1.8k](/packages/nikic-php-parser)[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k910.8M118](/packages/doctrine-lexer)[erusev/parsedown

Parser for Markdown.

15.0k151.8M732](/packages/erusev-parsedown)[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

3.0k404.0M702](/packages/league-commonmark)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)

PHPackages © 2026

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