PhpEnums

Extended PHP 8.1+ enums features & specific integrations with frameworks and libraries

MIT License

Downloads
2.6M
Stars
321
Committers
29

Bot releases are hidden (Show)

PhpEnums - v2.4.0: allow Symfony 7 Latest Release

Published by ogizanagi 10 months ago

Changelog

[bd65e9e] feature #227 Bump dependencies. test against symfony 7 (michnovka)

PhpEnums - v2.3.0

Published by ogizanagi 10 months ago

Changelog

[8b09a3a] feature #224 Implementation of the translatable interface. (laurentmuller)
[a64a1fa] bug #215 Fix AbstractEnumType convertToDatabase function to support string|int (michnovka)

PhpEnums - v2.2.0

Published by ogizanagi over 1 year ago

Changelog

[7266715] minor #196 Add context to (de)normalizer support check (mbrodala)
[dce599d] minor #209 Bump github workflows, fix mongodb Windows (michnovka)
[d6d138b] feature #210 Strong typed function params and return types (michnovka)
[f4a08aa] minor #216 allow int enum to be normalized as int (maximecolin)
[400030f] bug #218 [Validator] Fix 1.x enum constraint with named arguments (ogizanagi)
[d555de9] feature #219 Add phpstan (benji07, ogizanagi)

PhpEnums - v1.17.3: Fix enum constraint

Published by ogizanagi over 1 year ago

Changelog

[400030f] bug #218 [Validator] Fix 1.x enum constraint with named arguments (ogizanagi)

PhpEnums - v1.17.2

Published by ogizanagi over 1 year ago

Changelog

[306c78d] minor #189 [Docs] Explain how to use enums with Doctrine ORM QueryBuilder (pluk77)
[7266715] minor #196 Add context to (de)normalizer support check (mbrodala)
[f4a08aa] minor #216 allow int enum to be normalized as int (maximecolin)

PhpEnums - v2.1.2

Published by ogizanagi almost 2 years ago

Changelog

[96c2be4] minor #208 Removed unused bin reference in composer.json (michnovka)

PhpEnums - v2.1.1: fix Symfony 6.2 deprec

Published by ogizanagi almost 2 years ago

Changelog

[d32d60a] bug #205 [HttpKernel] Move the backed enum value resolver deprecation trigger to the constructor (ogizanagi)

PhpEnums - v2.1.0: Symfony 6.2 compat & ReadableEnum attribute

Published by ogizanagi almost 2 years ago

Changelog

[b20e8e8] minor #198 [CI] Update edges (@ogizanagi)
[e0bc146] minor #200 [CI] Fix Github Actions deprecations (@ogizanagi)
[a7aeecc] minor #202 [Tests] Remove unnecessary 6.2 config (@ogizanagi)
[74ba8a2] minor #204 Remove obsolete dump JS enum binary (@ogizanagi)
[baae644] feature #201 [Readable] Allow to configure a common suffix/prefix & use the enum case value/name as default label (@ogizanagi)

PhpEnums - v2.0.1: fix EnumCase inheritance usages

Published by ogizanagi over 2 years ago

Changelog

[306c78d] minor #189 [Docs] Explain how to use enums with Doctrine ORM QueryBuilder (@pluk77)
[52b33dd] minor #193 Fix PhpStan issue with FlagBag missing template on static methods (@laurentmuller)
[a296673] bug #197 Fix #[EnumCase] inheritance to set & get extras (@ogizanagi)

PhpEnums - v2.0.0: Rewrite with PHP 8.1 enums

Published by ogizanagi over 2 years ago

This is a complete rewrite of the library to leverage & add new capabilities over new PHP 8.1 native enums.
Some features are still awaited (https://github.com/Elao/PhpEnums/issues/124), but the main interfaces should not change by now, and the library will be improved in the next minor releases.

Thanks to every contributor who helped moving forward to this new version 🎉 ✨

Changelog

[e841eb6] feature #165 V2: Rewrite with PHP 8.1 enums (@ogizanagi)
[0bc5a0b] feature #167 Add VarDumper caster for readables (@ogizanagi)
[e4dacde] feature #168 Add VarDumper caster for flag bag (@ogizanagi)
[2aefece] feature #169 [HttpKernel] Add a controller argument resolver for backed enums (@ogizanagi)
[55781e1] minor #171 [Docs] Mention the official Doctrine ORM integration (@ogizanagi)
[7d08ee2] minor #173 fix phpstan phpdoc (@Kleinast)
[ec16823] bug #174 Override the block prefix (@benji07)
[c447d57] minor #175 Throw bad method call on attempt to call ReadableEnumTrait::readableForValue on non backed enum (@ogizanagi)
[1a1c3d6] feature #170 Allow to provide extra values to EnumCase attribute (@ogizanagi)
[27e0c46] feature #177 add Faker provider (@IonBazan, @ogizanagi)
[ad2d4fd] feature #176 Add Doctrine ODM integration (@IonBazan)
[98a03f3] feature #181 Add FlagBag::fromAll to instantiate a bag with all of its flags (@michnovka)
[7600213] feature #183 FlagBagType support (@michnovka)
[e623ba2] feature #182 Add SQL Enum support (@michnovka, @ogizanagi)
[7a6c730] feature #186 Initial DBAL FlagBag support (@michnovka)
[e6735d6] minor #187 Add missing ODM extensions test + XSD types (@ogizanagi)

PhpEnums - v2.0.0-rc.1

Published by ogizanagi over 2 years ago

Changelog

[e841eb6] feature #165 V2: Rewrite with PHP 8.1 enums (ogizanagi)
[0bc5a0b] feature #167 Add VarDumper caster for readables (ogizanagi)
[e4dacde] feature #168 Add VarDumper caster for flag bag (ogizanagi)
[2aefece] feature #169 [HttpKernel] Add a controller argument resolver for backed enums (ogizanagi)
[55781e1] minor #171 [Docs] Mention the official Doctrine ORM integration (ogizanagi)
[7d08ee2] minor #173 fix phpstan phpdoc (Kleinast)
[ec16823] bug #174 Override the block prefix (benji07)
[c447d57] minor #175 Throw bad method call on attempt to call ReadableEnumtrait::readableForValue on non backed enum (ogizanagi)
[1a1c3d6] feature #170 Allow to provide extra values to EnumCase attribute (ogizanagi)
[27e0c46] feature #177 add Faker provider (IonBazan, ogizanagi)
[ad2d4fd] feature #176 Add Doctrine ODM integration (IonBazan)
[98a03f3] feature #181 Add FlagBag::fromAll to instantiate a bag with all of its flags (michnovka)
[7600213] feature #183 FlagBagType support (michnovka)
[e623ba2] feature #182 Add SQL Enum support (michnovka, ogizanagi)

Since v2.0.0-beta.2:

[7a6c730] feature #186 Initial DBAL FlagBag support (@michnovka)
[e6735d6] minor #187 Add missing ODM extensions test + XSD types (@ogizanagi)

PhpEnums - v2.0.0-beta.2

Published by ogizanagi over 2 years ago

Changelog

[98a03f3] feature #181 Add FlagBag::fromAll to instantiate a bag with all of its flags (@michnovka)
[7600213] feature #183 FlagBagType support (@michnovka)
[e623ba2] feature #182 Add SQL Enum support (@michnovka, @ogizanagi)

PhpEnums - v2.0.0-beta.1

Published by ogizanagi over 2 years ago

Changelog

[27e0c46] feature #177 add Faker provider (@IonBazan, @ogizanagi)
[ad2d4fd] feature #176 Add Doctrine ODM integration (@IonBazan)

Full Changelog: https://github.com/Elao/PhpEnums/compare/v2.0.0-alpha.3...v2.0.0-beta.1

PhpEnums - v2.0.0-alpha.3

Published by ogizanagi over 2 years ago

Changelog

[c447d57] minor #175 Throw bad method call on attempt to call ReadableEnumtrait::readableForValue on non backed enum (@ogizanagi)
[1a1c3d6] feature #170 Allow to provide extra values to EnumCase attribute (@ogizanagi)

Full Changelog: https://github.com/Elao/PhpEnums/compare/v2.0.0-alpha.1...v2.0.0-alpha.3

PhpEnums - v1.17.1

Published by ogizanagi over 2 years ago

Changelog

[7d08ee2] minor #173 fix phpstan phpdoc (@Kleinast)

Full Changelog: https://github.com/Elao/PhpEnums/compare/v1.17.0...v1.17.1

PhpEnums - v2.0.0-alpha.2

Published by ogizanagi over 2 years ago

Changelog

[55781e1] minor #171 [Docs] Mention the official Doctrine ORM integration (@ogizanagi)
[ec16823] bug #174 Override the block prefix (@benji07)

Full Changelog: https://github.com/Elao/PhpEnums/compare/v2.0.0-alpha.1...v2.0.0-alpha.2

PhpEnums - v2.0.0-alpha.1

Published by ogizanagi almost 3 years ago

Changelog

[e841eb6] feature #165 V2: Rewrite with PHP 8.1 enums (@ogizanagi)

Which includes:

  • readables
  • flagbag
  • symfony readable form type
  • dbal types generations

[0bc5a0b] feature #167 Add VarDumper caster for readables (@ogizanagi)
[e4dacde] feature #168 Add VarDumper caster for flag bag (@ogizanagi)
[2aefece] feature #169 [HttpKernel] Add a controller argument resolver for backed enums (@ogizanagi)

PhpEnums - v1.17.0: Symfony 6 compatibility

Published by ogizanagi almost 3 years ago

Changelog

[9440cbd] minor #155 [CI] Use Flex for testing multiple Symfony versions (@ogizanagi)
[ed782a9] minor #156 Fix 5.4 deprecs & types (@ogizanagi)
[bbc7f2e] feature #157 Allow Symfony 6 (@ogizanagi)
[f2e761a] feature #132 Support default value for generated Doctrine types (@mbrodala)
[a27eece] feature #158 Support for denormalizing XML to an integer Readable enum (@ogizanagi)
[40a1a5a] minor #159 [CI] Limit mongo tests to edges checks (@ogizanagi)

Since v1.17.0-beta.1

[0d11457] minor #160 Fix typo (extra backtick character) in README (@sarim)
[1c944e3] bug #162 Do not trigger a deprecation on FQCN as both keys and values in Doctrine types config (@ogizanagi)
[33cfb10] minor #163 [CI] Prepare for next SF & PHP versions (@ogizanagi)
[89772dd] minor #164 [Docs] Hints about the PHPStan annotations (@ogizanagi)

What's Changed

Full Changelog: https://github.com/Elao/PhpEnums/compare/v1.16.0...v1.17.0

PhpEnums - v1.17.0-beta.1: Symfony 6 compatibility

Published by ogizanagi almost 3 years ago

This version fixes Symfony 5.4 types deprecations and allows Symfony 6.
A minor BC break is expected if you extended some of the DBAL type methods, due to #156.

This release also adds support for Doctrine DBAL types default value on null from configuration,
as well as better support for XML/CSV denormalization of integer based enums.

Changelog

[bbc7f2e] feature #157 Allow Symfony 6 (@ogizanagi)
[f2e761a] feature #132 Support default value for generated Doctrine types (@mbrodala)
[a27eece] feature #158 Support for denormalizing XML to an integer Readable enum (@ogizanagi)
[9440cbd] minor #155 [CI] Use Flex for testing multiple Symfony versions (@ogizanagi)
[ed782a9] minor #156 Fix 5.4 deprecs & types (@ogizanagi)
[40a1a5a] minor #159 [CI] Limit mongo tests to edges checks (@ogizanagi)

Full Changelog: https://github.com/Elao/PhpEnums/compare/v1.16.0...v1.17.0-beta.1

PhpEnums - v1.16.0

Published by ogizanagi about 3 years ago

Changelog

[7d4cb3c] bug #150 fix collection enum types for ODM (@IonBazan)
[345586f] feature #153 add native jsonSerialize (@IonBazan)
[075003f] bug #152 handle readable enums that contain values which need escaping in javascript (@bendavies)