Download the PHP package mrgoodbytes8667/enum-serializer-bundle without Composer
On this page you can find all versions of the php package mrgoodbytes8667/enum-serializer-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mrgoodbytes8667/enum-serializer-bundle
More information about mrgoodbytes8667/enum-serializer-bundle
Files in mrgoodbytes8667/enum-serializer-bundle
Package enum-serializer-bundle
Short Description A bundle to enable spatie/enum Serialization support in Symfony
License CC-BY-NC-4.0
Informations about the package enum-serializer-bundle
enum-serializer-bundle
A bundle to provide some helper methods for PHP 8.1+ enums inspired by spatie/enum
Upgrading to 6.0 from 5.x
- The EnumNormalizer will no longer be registered as a service by default. You must manually enable it to continue using it. It will be removed in v7.
Upgrading to 4.0 from 3.x
- Replace any usages of
Bytes\EnumSerializerBundle\Request\EnumParameterConverter
with ValueResolvers. See https://symfony.com/doc/current/controller/value_resolver.html
Upgrading to 3.0 from 2.x
- Replace the deprecated calls to
easyAdminChoices()
andformChoices()
withprovideFormChoices()
. - Upgrade any overridden versions of
provideFormChoices()
,getFormChoiceKey()
, andgetFormChoiceValue()
fromprotected
topublic
.
Upgrading to 2.0
Change all classes that extend Bytes\EnumSerializerBundle\Enums\Enum
to be string backed enums, using the new
Bytes\EnumSerializerBundle\Enums\StringBackedEnumTrait
trait and implementing the new
Bytes\EnumSerializerBundle\Enums\StringBackedEnumInterface
interface.
Bytes\EnumSerializerBundle\Enums\StringBackedEnumTrait
provides the previousEnum
class methods that are still relevant and needed with the switch to enums, including ajsonSerializable()
method to keep serialization consistent.Bytes\EnumSerializerBundle\Enums\StringBackedEnumInterface
must be implemented (or\JsonSerializable
) in order to have the serializer properly return label/value as it did prior to 2.0.- Note:
Bytes\EnumSerializerBundle\Enums\StringBackedEnumInterface
extends bothBytes\EnumSerializerBundle\Enums\EasyAdminChoiceEnumInterface
andBytes\EnumSerializerBundle\Enums\FormChoiceEnumInterface
, which both automatically provide EasyAdminBundle and Symfony form compatible choice methods and are easily overloadable.
Before
After
With Optional Deprecated Replacement for PHPStorm
Note that the automated replacement will not remove the trailing ()
following the function
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
License
Inspired by and based on the spatie/enum package.
All versions of enum-serializer-bundle with dependencies
illuminate/collections Version ^9.13 | ^10.0 | ^11.0
symfony/config Version ^6.3 | ^7.0
symfony/dependency-injection Version ^6.3 | ^7.0
symfony/framework-bundle Version ^6.3 | ^7.0
symfony/property-access Version ^6.3 | ^7.0
symfony/serializer Version ^6.3 | ^7.0
twig/twig Version ^2.12 | ^3.0