PHPackages                             emmetog/feature-flags - 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. emmetog/feature-flags

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

emmetog/feature-flags
=====================

A set of classes to easily use feature flags in a PHP application

v0.1.0(9y ago)01162[2 PRs](https://github.com/emmetog/feature-flags/pulls)MITPHP

Since May 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/emmetog/feature-flags)[ Packagist](https://packagist.org/packages/emmetog/feature-flags)[ RSS](/packages/emmetog-feature-flags/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/e76f179c99704c9c93cc558aaedfb375fbb673aa7d7aaa0ccd3bc4ae8404be11/68747470733a2f2f7472617669732d63692e6f72672f656d6d65746f672f666561747572652d666c6167732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/emmetog/feature-flags)

Feature Flags
=============

[](#feature-flags)

This library gives you "feature flag" functionality.

Why is this useful? If you want to implement "feature flags" in your application where features are only enabled for certain people, then this library will help. It allows you to do continuous delivery because you can ship features to production even when they are not quite ready for the masses, the trick is to deploy the feature disabled and enable it to only a select few. When it's ready you can remove the feature flag from the code and boom, the feature is now enabled for everyone.

Usage
-----

[](#usage)

To use this library you'll need to extend the `FeatureRepositoryInterface` and `FeatureFlagRepositoryInterface`interfaces. These interfaces describe the interaction with the database. The classes should return `Feature`and `FeatureFlag` entities respectively.

Once you've done this, inject them into the `FeatureEnabledChecker` service. If you use the Symfony Dependency Injection Container then you can define this service in your services.yml.

Check if a feature is enabled like this:

```
$featureEnabledChecker = new FeatureEnabledChecker(
    $myFeatureRepository
    $myFeatureFlagRepository,
);

$isFeatureEnabledForUser = $featureEnabledChecker->isFeatureEnabled('my_cool_feature', 'my_user_id');
```

SemVer Sentry
-------------

[](#semver-sentry)

You'll find a report of the semantic version conformance of the past releases of this repo here:

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

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

Total

2

Last Release

3635d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64ff03b36365513bc3ceb72fca15b17d2ded1bbba8f2eeaf9c37ce7e817579ed?d=identicon)[emmetog](/maintainers/emmetog)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/emmetog-feature-flags/health.svg)

```
[![Health](https://phpackages.com/badges/emmetog-feature-flags/health.svg)](https://phpackages.com/packages/emmetog-feature-flags)
```

PHPackages © 2026

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