Skip to content

Latest commit

 

History

History
252 lines (133 loc) · 8.63 KB

CHANGELOG.md

File metadata and controls

252 lines (133 loc) · 8.63 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Added

  • Allow Description attribute usage on class 270

Changed

  • Require composer/class-map-generator over composer/composer 268

5.3.1 - 2022-06-22

Fixed

  • Narrow property type hints 258

5.3.0 - 2022-04-08

Fixed

  • Return value for invalid enum case when using the Description attribute 264

Fixed

  • Type-hint Enum::$key and Enum::$description as string
  • Type-hint FlaggedEnum::$value as int

5.2.0 - 2022-03-11

Fixed

  • Publish language definitions to lang directory 254

Added

  • Restore enum instance from var_export() 252

5.1.0 - 2022-02-09

Added

  • Ability to define enum case descriptions using Description attribute.

5.0.0 - 2022-02-09

Added

  • Support for Laravel 9

Changed

  • The annotate command now uses composer to parse directories for instances of enums instead of hanneskod/classtools

Removed

  • Removed old CastsEnums trait. Laravel attribute casting should be used now instead. 247

4.2.0 - 2022-01-31

Fixed

  • Fix return type on FlaggedEnum flags method 241
  • Suppress deprecated notice on PHP8.1 236

4.1.0 - 2021-11-16

Added

  • Allow package to be installed with PHP 8.1 #233

Changed

  • Allow laminas/laminas-code:^4.0 as a dependency #233

4.0.0 - 2021-11-09

Fixed

  • Fixed validation error message localization when using string validation rules #227

Changed

  • Extend the functionality of the getKeys() and getValues() methods #223

Added

  • Added new method notIn() to check whether a value is not in an iterable set of values #232

3.4.2 - 2021-09-09

Fixed

  • Fixed broken enums due to wrapping of long constant names in method annotations #226

3.4.1 - 2021-06-17

Fixed

  • Fixed type issued in PHP 7.3

3.4.0 - 2021-06-17

Added

  • addAllFlags() method to flagged enums
  • removeAllFlags() method to flagged enums

Fixed

  • Fixed coercion of flagged enums when the value represents multiple flags

3.3.0 - 2021-02-16

Changed

  • Update doctrine/dbal requirement from ^2.9 to ^2.9|^3.0 #208
  • Allow passing iterables to Enum::in() #212

Fixed

  • fix: $model->getChanges() triggered due to strict comparison #187
  • Fixed issue in getFriendlyKeyNamewhen uppercase key contains non-alpha characters #210

3.2.0 - 2020-12-15

Added

  • PHP 8.0 support #203

Changed

  • Switched from Travis to GitHub Actions

3.1.0 - 2020-10-22

Added

  • Added trait to query flagged enums using Eloquent #180
  • Add the option to publish enums stubs #182

Changed

  • Improved test equality strictness #185

Fixed

  • fix:toSelectArray breaking change + document toArray change #184

3.0.0 - 2020-08-07

Added

  • Support for Laravel 8

Fixed

  • Model annotation has been removed in favour of laravel-ide-helper #165

2.2.0 - 2020-08-30

Fixed

  • Model attributes which use Laravel 7 native casting now return the enum value when serialized. #162 #163

Deprecated

  • Enum::toArray() should no longer be called statically, instead use Enum::asArray().

2.1.0 - 2020-07-24

Fixed

  • Allow returning null when using native casting #152

2.0.0 - 2020-07-02

Added

  • Native attribute casting #131

Changed

  • Require Laravel 7.5 or higher
  • Require PHP 7.2.5 or higher

Deprecated

  • Deprecate legacy attribute casting in favor of native casting

1.38.0 - 2020-06-07

Fixed

  • Handle calling magic instantiation methods from within instance methods of the Enum #147
  • Add new instantiation methods Enum::fromKey() and Enum::fromValue() #142
  • Fixed issue with localized validation messages #141

Deprecated

  • Deprecate Enum::getInstance() in favor of Enum::fromValue()

1.37.0 - 2020-04-11

Changed

  • EnumValue validation rule allows multiple flags for FlaggedEnums

1.36.0 - 2020-03-22

Changed

  • Validation messages are now pulled from translation files #134

1.35.0 - 2020-03-16

Changed

  • Added missing pipe validation syntax for enum instance validation #132

1.34.0 - 2020-03-13

Changed

1.33.0 - 2020-03-05

Added

  • Add Laravel 7.x compatibility

1.32.0 - 2020-02-11

Added

  • Add tests and make EnumMethodReflection return generating constant values for isInternal, isDeprecated, and getDeprecatedDescription #121

1.31.0 - 2020-02-09

Added

  • Add compatibility with PHPStan 0.12.x #119
  • Changelog started.