PHPackages                             neutronstars/symfony-normalizer-enum-php - 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. [Database &amp; ORM](/categories/database)
4. /
5. neutronstars/symfony-normalizer-enum-php

ActiveLibrary[Database &amp; ORM](/categories/database)

neutronstars/symfony-normalizer-enum-php
========================================

Added Symfony normalizer for the enumeration system designed to be as close to PHP 8.1 for earlier versions.

1.1.0(4y ago)113Apache-2.0PHPPHP ^7.1 | ^8.0

Since Jul 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Neutron-Pro/symfony-normalizer-enum-php)[ Packagist](https://packagist.org/packages/neutronstars/symfony-normalizer-enum-php)[ RSS](/packages/neutronstars-symfony-normalizer-enum-php/feed)WikiDiscussions develop Synced 2d ago

READMEChangelog (2)Dependencies (3)Versions (5)Used By (0)

Symfony Normalizer Enum Type
============================

[](#symfony-normalizer-enum-type)

---

Read the enum php doc:
----------------------

[](#read-the-enum-php-doc)

>

---

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

[](#installation)

```
composer require neutronstars/symfony-normalizer-enum-php

```

### Add doctrine:

[](#add-doctrine)

```
composer require neutronstars/doctrine-enum-php-type

```

>

---

### Example for serialize an object entity with an enum field:

[](#example-for-serialize-an-object-entity-with-an-enum-field)

```
/**
 * @method static self WAITING()
 * @method static self PUBLISHED()
 */
class MyStringEnum extends \NeutronStars\Enum\Enum {
  public const WAITING   = 'Waiting';
  public const PUBLISHED = 'Published';
}

/**
 * @Entity()
 */
class Post {
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     * @Groups(["post:details"])
     * @var int
     */
     private $id;

     // ... Other field (name, createdAt, updatedAt etc..)

     /**
      * For the customs type, please check the doctrine enum type documentation.
      * @ORM\Column(type="my_string_enum")
     *  @Groups(["post:details"])
      * @var MyStringEnum
      */
      private $state;

      public function __construct() {
        $this->state = MyStringEnum::WAITING();
      }

      // ... All methods implemented.
}

/**
 * @Route("/posts", name="list_post")
 */
class ListPostController {

    /** @var PostRepository PostRepository */
    private $postRepository;

    public function __construct(PostRepository $postRepository) {
        $this->postRepository = $postRepository;
    }

    public function __invoke(): JSONResponse
    {
        $serializer = new \Symfony\Component\Serializer\Serializer([
            new \NeutronStars\Symfony\Enum\Normalizer\EnumNormalizer(MyStringEnum::class)
        ], [new \Symfony\Component\Serializer\Encoder\JsonEncode()]);

        return new JSONResponse(
            $serializer->normalize(
                $this->postRepository->findAll(),
                null,
                [ 'groups' => ['post:details'] ]
            )
        );
    }
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

4

Last Release

1767d ago

### Community

Maintainers

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

---

Tags

doctrinephpphp-enumphp-libraryphp7php8symfony

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/neutronstars-symfony-normalizer-enum-php/health.svg)

```
[![Health](https://phpackages.com/badges/neutronstars-symfony-normalizer-enum-php/health.svg)](https://phpackages.com/packages/neutronstars-symfony-normalizer-enum-php)
```

###  Alternatives

[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[dunglas/doctrine-json-odm

An object document mapper for Doctrine ORM using JSON types of modern RDBMS.

6285.0M10](/packages/dunglas-doctrine-json-odm)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[bolt/core

🧿 Bolt Core

585142.5k54](/packages/bolt-core)[guikingone/scheduler-bundle

A Symfony bundle that allows to schedule and create repetitive tasks

114217.4k](/packages/guikingone-scheduler-bundle)[vinyvicente/doctrine-point-type

17230.3k1](/packages/vinyvicente-doctrine-point-type)

PHPackages © 2026

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