PHPackages                             carloswph/configurable - 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. carloswph/configurable

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

carloswph/configurable
======================

Configurable interface, its abstract class implementation and a trait.

0.9.0(4y ago)25MITPHP

Since Mar 3Pushed 4y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Configurable Interface
======================

[](#configurable-interface)

A lot of scripts and packages in modern PHP demand one or more configuration classes. Mostly, those are a set of properties that can be set, changed or retrieved. However, some of the configurations have a peculiar behaviour - such as boolean properties. Also, we want some of the settings to be manageable in the future - for some other we want values to remain immutable after a first setup.

There are plenty of proposed interfaces for that - what is different in this Configurable interface are two methods in particular: immutable() and switch().

This packages brings a Configurable interface and an abstract that comprises a very objective implementation of that. Shortly, we are also going to provide a trait with the same function.

Equipped with standard methods for this kind of class, such as **get()**, **set()** and **getDefaults** (this last retrieving all properties as they are in that moment), both the interface and the abstract propose two new methods:

The immutable() method
----------------------

[](#the-immutable-method)

The **immutable** method allows a property to be set or redefined (if the class already brings any default value) just once. After that, the property key is stored in a private variable and any new attempt of setting new values will be ignored.

The switch() method
-------------------

[](#the-switch-method)

This method provides a quick and simpler way of changing one or more boolean properties. As the name suggests, any property set as FALSE will be switched to TRUE, so as it makes all TRUE values to become FALSE.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

1582d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/78516217?v=4)[Carlos Artur Curvelo da Silva Matos](/maintainers/carloswph)[@carloswph](https://github.com/carloswph)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/carloswph-configurable/health.svg)

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

###  Alternatives

[silverstripe/subsites

Run multiple sites from a single SilverStripe install.

64400.9k21](/packages/silverstripe-subsites)[ayesh/php-timer

High-resolution and monotonic stop-watch for all your needs. Supports timer start, pause, resume, stop, read, and minimal conversion.

25235.3k13](/packages/ayesh-php-timer)

PHPackages © 2026

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