PHPackages                             agence-adeliom/easy-common-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. agence-adeliom/easy-common-bundle

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

agence-adeliom/easy-common-bundle
=================================

A Symfony bundle for EasyAdmin that provide basic entity traits and a enum helper

3.0.2(5mo ago)324.6k↑34.4%614MITPHPPHP &gt;=8.2

Since Feb 2Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/agence-adeliom/easy-common-bundle)[ Packagist](https://packagist.org/packages/agence-adeliom/easy-common-bundle)[ Docs](https://github.com/agence-adeliom/easy-common-bundle)[ RSS](/packages/agence-adeliom-easy-common-bundle/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelogDependencies (5)Versions (134)Used By (14)

[![Adeliom](https://camo.githubusercontent.com/cfcea17cd5354fe5c47c2873d4ec93e8d84e1468240bc616fdfb9196dc032093/68747470733a2f2f6164656c696f6d2e636f6d2f7075626c69632f75706c6f6164732f323031372f30392f4164656c696f6d5f6c6f676f2e706e67)](https://camo.githubusercontent.com/cfcea17cd5354fe5c47c2873d4ec93e8d84e1468240bc616fdfb9196dc032093/68747470733a2f2f6164656c696f6d2e636f6d2f7075626c69632f75706c6f6164732f323031372f30392f4164656c696f6d5f6c6f676f2e706e67)[![Quality gate](https://camo.githubusercontent.com/044c18ad32c64855dcfe3cae1c61a98fe47beccd26c77f4805f1f711e0694a98/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f7175616c6974795f676174653f70726f6a6563743d6167656e63652d6164656c696f6d5f656173792d636f6d6d6f6e2d62756e646c65)](https://sonarcloud.io/dashboard?id=agence-adeliom_easy-common-bundle)

Easy Common Bundle
==================

[](#easy-common-bundle)

Provide base utilities for Easyadmin.

Features
--------

[](#features)

- A Enum polyfill for PHP 8 (&lt; 8.1.0)
- Some Traits for entities

Versions
--------

[](#versions)

Repository BranchVersionSymfony CompatibilityPHP CompatibilityStatus`3.x``3.x``6.4`, and `7.x``8.2` or higherNew features and bug fixes`2.x``2.x``5.4`, and `6.x``8.0.2` or higherBug fixes`1.x``1.x``4.4`, and `5.x``7.2.5` or higherNo longer maintainedInstallation
------------

[](#installation)

Install with composer

```
composer require agence-adeliom/easy-common-bundle
```

### Traits

[](#traits)

- [ID](src/Traits/EntityIdTrait.php)
- [Name and Slug](src/Traits/EntityNameSlugTrait.php)
- [Name](src/Traits/EntityNameTrait.php)
- [Publishable](src/Traits/EntityPublishableTrait.php)
- [Status](src/Traits/EntityStatusTrait.php)
- [Three State Status](src/Traits/EntityThreeStateStatusTrait.php)
- [Timestampable](src/Traits/EntityTimestampableTrait.php)
- [Soft Deletable](src/Traits/EntitySoftDeletableTrait.php)

### Enum helper

[](#enum-helper)

#### Declaration

[](#declaration)

```
use Adeliom\EasyCommonBundle\Helper\Enum;

/**
 * Action enum
 */
final class Action extends Enum
{
    private const VIEW = 'view';
    private const EDIT = 'edit';
}
```

#### Usage

[](#usage)

```
$action = Action::VIEW();

// or with a dynamic key:
$action = Action::$key();
// or with a dynamic value:
$action = Action::from($value);
// or
$action = new Action($value);
```

As you can see, static methods are automatically implemented to provide quick access to an enum value.

One advantage over using class constants is to be able to use an enum as a parameter type:

```
function setAction(Action $action) {
    // ...
}
```

#### Documentation

[](#documentation)

- `__construct()` The constructor checks that the value exist in the enum
- `__toString()` You can `echo $myValue`, it will display the enum value (value of the constant)
- `getValue()` Returns the current value of the enum
- `getKey()` Returns the key of the current value on Enum
- `equals()` Tests whether enum instances are equal (returns `true` if enum values are equal, `false` otherwise)

Static methods:

- `from()` Creates an Enum instance, checking that the value exist in the enum
- `toArray()` method Returns all possible values as an array (constant name in key, constant value in value)
- `keys()` Returns the names (keys) of all constants in the Enum class
- `values()` Returns instances of the Enum class of all Enum constants (constant name in key, Enum instance in value)
- `isValid()` Check if tested value is valid on enum set
- `isValidKey()` Check if tested key is valid on enum set
- `assertValidValue()` Assert the value is valid on enum set, throwing exception otherwise
- `search()` Return key for searched value

##### Static methods

[](#static-methods)

```
final class Action extends Enum
{
    private const VIEW = 'view';
    private const EDIT = 'edit';
}

// Static method:
$action = Action::VIEW();
$action = Action::EDIT();
```

Static method helpers are implemented using [`__callStatic()`](http://www.php.net/manual/en/language.oop5.overloading.php#object.callstatic).

If you care about IDE autocompletion, you can either implement the static methods yourself:

```
final class Action extends Enum
{
    private const VIEW = 'view';

    /**
     * @return Action
     */
    public static function VIEW() {
        return new Action(self::VIEW);
    }
}
```

or you can use phpdoc (this is supported in PhpStorm for example):

```
/**
 * @method static Action VIEW()
 * @method static Action EDIT()
 */
final class Action extends Enum
{
    private const VIEW = 'view';
    private const EDIT = 'edit';
}
```

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

Authors
-------

[](#authors)

- [@arnaud-ritti](https://github.com/arnaud-ritti)

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance81

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 55.6% 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 ~11 days

Recently: every ~71 days

Total

132

Last Release

63d ago

Major Versions

1.0.0 → 2.0.42022-08-26

2.0.115 → 3.0.0-alpha2025-03-05

2.0.129 → 3.02025-11-05

PHP version history (3 changes)1.0.0PHP ^7.4|^8.0

2.0.4PHP &gt;=8.0.2

3.0.0-alphaPHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6471ac11bb69c46070e9140c9272639d3fe4b569c68ef8cde7cf60b0aa4ce9e6?d=identicon)[arnaud-ritti](/maintainers/arnaud-ritti)

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

---

Top Contributors

[![jdadeliom](https://avatars.githubusercontent.com/u/97044531?v=4)](https://github.com/jdadeliom "jdadeliom (5 commits)")[![JeanDavidDaviet](https://avatars.githubusercontent.com/u/1676202?v=4)](https://github.com/JeanDavidDaviet "JeanDavidDaviet (2 commits)")[![jeromeengeln](https://avatars.githubusercontent.com/u/51697251?v=4)](https://github.com/jeromeengeln "jeromeengeln (2 commits)")

---

Tags

easyadminsymfonysymfonyhelperenumeasyadmin

### Embed Badge

![Health badge](/badges/agence-adeliom-easy-common-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/agence-adeliom-easy-common-bundle/health.svg)](https://phpackages.com/packages/agence-adeliom-easy-common-bundle)
```

###  Alternatives

[pentatrion/vite-bundle

Vite integration for your Symfony app

2755.3M13](/packages/pentatrion-vite-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[pugx/autocompleter-bundle

Add an autocomplete type to forms

93861.6k3](/packages/pugx-autocompleter-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[sineflow/clamav

ClamAV PHP Client for Symfony

10168.5k](/packages/sineflow-clamav)

PHPackages © 2026

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