PHPackages                             j4nr6n/feature-flag-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. j4nr6n/feature-flag-bundle

ActiveSymfony-bundle

j4nr6n/feature-flag-bundle
==========================

FeatureFlags

0.0.1(2y ago)021MITPHPPHP &gt;=8.3

Since Mar 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/j4nr6n/feature-flag-bundle)[ Packagist](https://packagist.org/packages/j4nr6n/feature-flag-bundle)[ Docs](https://github.com/j4nr6n/feature-flag-bundle)[ RSS](/packages/j4nr6n-feature-flag-bundle/feed)WikiDiscussions main Synced 1mo ago

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

j4nr6n/feature-flag-bundle
==========================

[](#j4nr6nfeature-flag-bundle)

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

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Open a command console, enter your project directory and execute:

```
$ composer require j4nr6n/feature-flag-bundle
```

### Applications that don't use Symfony Flex

[](#applications-that-dont-use-symfony-flex)

Enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    j4nr6n\FeatureFlagBundle\FeatureFlagBundle::class => ['all' => true],
];
```

Using The Bundle
----------------

[](#using-the-bundle)

A voter is an easy way to isolate the code for a given feature, but can also be used to "vote" on more than one feature.

```
// src/FeatureFlag/MyFeatureVoter.php

// ...
use j4nr6n\FeatureFlagBundle\FeatureVoterInterface;

class MyFeatureVoter implements FeatureVoterInterface
{
    public function supports(string $featureFlag): bool
    {
        return $featureFlag === 'my_new_feature';
    }

    public function isEnabled(string $featureFlag, array $context = []): bool
    {
        // ...
    }
}
```

You can create as many feature voters as you want. Remember though, if any single registered voter returns `true`. The final result will be `true`.

### In Controllers

[](#in-controllers)

```
// src/Controller/DefaultController.php

// ...
use j4nr6n\FeatureFlagBundle\FeatureCheckerInterface;

class DefaultController extends AbstractController
{
    // ...

    #[Route(name: 'app_default_homepage', methods: [Request::METHOD_GET])]
    public function homepage(FeatureCheckerInterface $featureChecker): Response
    {
        return $featureChecker->isEnabled('new_homepage', ['user' => $this->getUser()])
            ? $this->render('default/new_homepage.html.twig')
            : $this->render('default/homepage.html.twig');
    }
}
```

### In Services

[](#in-services)

```
// src/Service/SomeService.php

// ...
use j4nr6n/FeatureFlagBundle\FEatureCheckerInterface;

class SomeService
{
    public function __construct(
        private readonly FeatureCheckerInterface $featureChecker
    ) {
    }

    public function someMethod() {
        return $this->featureChecker->isEnabled('new_feature')
            ? // Let them experience our greatness!
            : // Not yet...
    }
}
```

### In Twig

[](#in-twig)

```
{% include feature_is_enabled('fancy_widget')
    ? '_fancy_widget.html.twig'
    : '_plain_widget.html.twig'
%}
```

Feature Checkers
----------------

[](#feature-checkers)

If feature voters aren't working out, you can also create your own feature "checker". See the [`Feature Checker`](docs/feature_checkers.md) documentation for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

779d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66256d2f63fdde20fb49c350516d4952040299054d57dd0d60b9f2e592b6c280?d=identicon)[j4nr6n](/maintainers/j4nr6n)

---

Top Contributors

[![j4nr6n](https://avatars.githubusercontent.com/u/3661151?v=4)](https://github.com/j4nr6n "j4nr6n (8 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/j4nr6n-feature-flag-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/j4nr6n-feature-flag-bundle/health.svg)](https://phpackages.com/packages/j4nr6n-feature-flag-bundle)
```

###  Alternatives

[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k172.9M1.8k](/packages/symfony-security-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M385](/packages/shopware-core)

PHPackages © 2026

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