PHPackages                             emaphp/fluent-configuration - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. emaphp/fluent-configuration

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

emaphp/fluent-configuration
===========================

A fluent configuration trait for PHP

1.2(11y ago)11581MIT LicensePHPPHP &gt;=5.4.0

Since Oct 22Pushed 11y ago1 watchersCompare

[ Source](https://github.com/emaphp/fluent-configuration)[ Packagist](https://packagist.org/packages/emaphp/fluent-configuration)[ RSS](/packages/emaphp-fluent-configuration/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)DependenciesVersions (4)Used By (1)

fluent-configuration
====================

[](#fluent-configuration)

A fluent configuration trait for PHP

[![Build Status](https://camo.githubusercontent.com/d2e7d95f433c5fdc3b0dec24cfc05d62932ec2312c9f25628c81f8f6ecce4b7c/68747470733a2f2f7472617669732d63692e6f72672f656d617068702f666c75656e742d636f6e66696775726174696f6e2e737667)](https://travis-ci.org/emaphp/fluent-configuration)

\###Changelog **2014-02-23**

- Modified: Method 'append' renamed to push.
- Added: Method 'pop'.

\###Installation **composer.json**

```
{
    "require": {
        "emaphp/fluent-configuration": "1.2.*"
    }
}
```

\###Usage
\*\*Include trait\*\* ```php namespace Demo; class ConfigurationContainer { use \\FluentConfiguration; }

```

**Examples**

```php
use Demo\ConfigurationContainer;

$config = new ConfigurationContainer();

//set option
$config->setOption('test1', 'value1');
$option = $config->getOption('test1'); // 'value1'

//fluent interface
$newInstance = $config->option('test2', 'value2')->option('test3', 'value3');
$newInstance->getOption('test2'); // 'value2'
$config->hasOption('test2'); //false
$config->hasOption('test3'); //false

//merge options
$config = $newInstance->merge(['test3' => 'new_value', 'test4' => 'value4']);
$config->getOption('test1'); // 'value1'
$config->getOption('test3'); // 'new_value'
$config->getOption('test4'); // 'value4'
$newInstance->hasOption('test4'); // false

//discard
$config = $config->discard('test1', 'test3');
$config->hasOption('test1'); // false
$config->hasOption('test3'); // false
$config->hasOption('test4'); // true

//push & pop
$config = new ConfigurationContainer();
$config->setOption('list', 'item1');
$config = $config->push('list', 'item2', 'item3');
$config->getOption('list'); // ['item1', 'item2', 'item3']
$value = $config->pop('list'); // 'item3'

//preserve instance
$config = new ConfigurationContainer();
$config->preserveInstance = true;
$config->setOption('test1', 'val1');
$newConf = $config->option('test2', 'val2');
$config->hasOption('test1'); // true
$config->hasOption('test2'); // true
$newConf->getOption('test2') == $config->getOption('test2'); // true

```

\###License Released under the MIT license.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~62 days

Total

3

Last Release

4139d ago

### Community

Maintainers

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

---

Top Contributors

[![emaphp](https://avatars.githubusercontent.com/u/3780753?v=4)](https://github.com/emaphp "emaphp (5 commits)")

---

Tags

phpconfigurationtraitfluent

### Embed Badge

![Health badge](/badges/emaphp-fluent-configuration/health.svg)

```
[![Health](https://phpackages.com/badges/emaphp-fluent-configuration/health.svg)](https://phpackages.com/packages/emaphp-fluent-configuration)
```

###  Alternatives

[kkszymanowski/traitor

Add a trait use statement to existing PHP class

1305.5M16](/packages/kkszymanowski-traitor)[hedii/laravel-date-range

A date range trait with local scope methods for Laravel Eloquent models

2140.6k](/packages/hedii-laravel-date-range)[samrap/gestalt

Gestalt is a simple, elegant PHP package for managing your framework's configuration values.

163.6k3](/packages/samrap-gestalt)

PHPackages © 2026

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