PHPackages                             aubes/openfeature-bundle - 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. aubes/openfeature-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

aubes/openfeature-bundle
========================

Symfony bundle for OpenFeature PHP SDK

v0.2.0(1mo ago)116MITPHPPHP &gt;=8.2CI passing

Since Apr 11Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/aubes/openfeature-bundle)[ Packagist](https://packagist.org/packages/aubes/openfeature-bundle)[ RSS](/packages/aubes-openfeature-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (13)Versions (4)Used By (0)

OpenFeature Bundle
==================

[](#openfeature-bundle)

[![CI](https://github.com/aubes/openfeature-bundle/actions/workflows/php.yml/badge.svg)](https://github.com/aubes/openfeature-bundle/actions/workflows/php.yml)[![Latest Version](https://camo.githubusercontent.com/5f365bee9434740526c454f6cf640cb9638f8c28d3b1370e7d42e9649b3d6ee9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61756265732f6f70656e666561747572652d62756e646c652e737667)](https://packagist.org/packages/aubes/openfeature-bundle)[![PHP Version](https://camo.githubusercontent.com/744f8821cc27dec8b0013ade48179731a44eadf4f943e0b1d9ffcb93f80177de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d626c75652e737667)](https://www.php.net)[![Symfony Version](https://camo.githubusercontent.com/fe64876f8937f7f6753e1076c25295ab87ce6c0729f69ac04f3e93247f5ad9c4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d362e34253230253743253230372e78253230253743253230382e782d677265656e2e737667)](https://symfony.com)

Feature flags, the Symfony way.

Symfony bundle for the [OpenFeature PHP SDK](https://github.com/open-feature/php-sdk) — the [CNCF standard](https://openfeature.dev) for feature flags.

```
class CheckoutController
{
    #[FeatureGate('new_checkout')]
    public function checkout(
        #[FeatureFlag('dark_mode')] bool $darkMode,
        #[FeatureFlag('max_items')] int $maxItems,
    ): Response {
        // values resolved from your feature flag provider
    }
}
```

- **`#[FeatureGate]`** blocks access when a flag is off
- **`#[FeatureFlag]`** injects resolved values, fully typed
- **Twig** helpers: `feature('flag')`, `feature_value('flag', default)`
- **Hooks** autoconfigured: implement `Hook` for logging, tracing, validation
- **Evaluation context** autoconfigured: implement `EvaluationContextProviderInterface` to feed targeting attributes
- **Symfony Profiler** panel with evaluated flags, provider info, and context
- **Any provider**: basic built-ins (InMemory, EnvVar, Redis) for quick starts, or plug any real OpenFeature provider (Flagd, ConfigCat, Unleash, LaunchDarkly...)
- **FrankenPHP** worker mode safe out of the box

Requirements
------------

[](#requirements)

- PHP 8.2+
- Symfony 6.4, 7.x or 8.x
- `open-feature/sdk` ^2.0 (implements [OpenFeature spec v0.5.1](https://github.com/open-feature/spec/releases/tag/v0.5.1))

Quick start
-----------

[](#quick-start)

```
composer require aubes/openfeature-bundle
```

> Register the bundle manually in `config/bundles.php`:
>
> ```
> Aubes\OpenFeatureBundle\OpenFeatureBundle::class => ['all' => true],
> ```

```
# config/packages/open_feature.yaml
open_feature:
    flags:
        new_checkout: true
        dark_mode: false
        max_items: 10
```

Use flags in controllers with attributes, in templates with Twig, or inject the `Client` directly:

```
use OpenFeature\interfaces\flags\Client;

class MyService
{
    public function __construct(private readonly Client $client) {}

    public function checkout(): void
    {
        if ($this->client->getBooleanValue('new_checkout', false)) {
            // new flow
        }
    }
}
```

```
{% if feature('new_checkout') %}
    {# new checkout #}
{% endif %}

{{ feature_value('max_items', 10) }}
```

Providers
---------

[](#providers)

The bundle works with any [OpenFeature provider](https://openfeature.dev/ecosystem/?instant_search%5BrefinementList%5D%5Btype%5D%5B0%5D=Provider&instant_search%5BrefinementList%5D%5Btechnology%5D%5B0%5D=PHP).

### Use a real provider in production

[](#use-a-real-provider-in-production)

For anything beyond a quick demo (user targeting, percentage rollouts, A/B testing, remote flag management, audit log), use a dedicated provider:

- [`aubes/openfeature-flagd-bundle`](https://github.com/aubes/openfeature-flagd-bundle) : self-hosted [Flagd](https://flagd.dev/) backend from the OpenFeature project
- [`aubes/openfeature-configcat-bundle`](https://github.com/aubes/openfeature-configcat-bundle) : [ConfigCat](https://configcat.com/) SaaS
- Any other provider from [open-feature/php-sdk-contrib](https://github.com/open-feature/php-sdk-contrib) (Unleash, LaunchDarkly, Split, GO Feature Flag, ...)

### Built-in providers (bootstrap only)

[](#built-in-providers-bootstrap-only)

> **Warning:** The three built-in providers are **simple key/value stores**. They ignore the `EvaluationContext` (no targeting, no rollouts, no A/B testing) and are only meant to get you running without setting up infrastructure. Swap them out as soon as you need real feature flag semantics.

ProviderBest forConfig keyInMemoryProvider *(default)*Local development, tests`flags`EnvVarProviderKill switches via env vars`provider`RedisProviderShared on/off toggles via Redis`provider` + `redis`Documentation
-------------

[](#documentation)

Full documentation lives in the [`docs/`](docs/index.md) folder:

- [Getting started](docs/getting-started.md)
- [Configuration reference](docs/configuration.md)
- [Providers](docs/providers/index.md) (Flagd, ConfigCat, built-ins for bootstrap)
- [Features](docs/features/index.md) (#\[FeatureFlag\], #\[FeatureGate\], Twig, EvaluationContext, Hooks)
- [Profiler &amp; Debug](docs/profiler.md)

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance91

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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

Every ~7 days

Total

3

Last Release

45d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3941035?v=4)[A. Bes](/maintainers/aubes)[@aubes](https://github.com/aubes)

---

Top Contributors

[![aubes](https://avatars.githubusercontent.com/u/3941035?v=4)](https://github.com/aubes "aubes (6 commits)")

---

Tags

cncffeature-flagsopenfeaturephpsymfonysymfony-bundlesymfonyfeature toggleopenfeaturefeature flagcncf

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aubes-openfeature-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/aubes-openfeature-bundle/health.svg)](https://phpackages.com/packages/aubes-openfeature-bundle)
```

PHPackages © 2026

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