Skip to content

Commit 1589a36

Browse files
committed
Document changes
1 parent 4baf6b9 commit 1589a36

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Changed
1111

1212
- Require composer/class-map-generator over composer/composer [268](https://github.com/BenSampo/laravel-enum/pull/268)
13+
- Use native types whenever possible
14+
- Throw when calling `Enum::getDescription()` with invalid values
15+
- Expect class-string in `InvalidEnumMemberException` constructor
16+
17+
### Fixed
18+
19+
- Leverage late static binding for instantiation methods in PHPStan extension
1320

1421
## [5.3.1](https://github.com/BenSampo/laravel-enum/compare/v5.3.0...v5.3.1) - 2022-06-22
1522

LICENCE.txt LICENSE.txt

File renamed without changes.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Created by [Ben Sampson](https://sampo.co.uk)
4949

5050
## Documentation for older versions
5151

52-
You are reading the documentation for `5.x`.
52+
You are reading the documentation for `6.x`.
5353

5454
- If you're using **Laravel 8** please see the [docs for `4.x`](https://github.com/BenSampo/laravel-enum/blob/v4.2.0/README.md).
5555
- If you're using **Laravel 7** please see the [docs for `2.x`](https://github.com/BenSampo/laravel-enum/blob/v2.2.0/README.md).
@@ -109,7 +109,7 @@ final class UserType extends Enum
109109
```
110110

111111
That's it! Note that because the enum values are defined as plain constants,
112-
you can simple access them like any other class constant.
112+
you can simply access them like any other class constant.
113113

114114
```php
115115
UserType::Administrator // Has a value of 0

UPGRADE.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Upgrade Guide
22

3+
## 6.x
4+
5+
### Native types
6+
7+
The library now uses native types whenever possible.
8+
When you override methods or implement interfaces, you will need to add them.
9+
10+
### `Enum::getDescription()` throws
11+
12+
Instead of returning an empty string `''` on invalid values,
13+
`Enum::getDescription()` will throw an `InvalidEnumMemberException`.
14+
15+
### Construct `InvalidEnumMemberException`
16+
17+
The constructor of `InvalidEnumMemberException` now expects the class name
18+
of an enum instead of an enum instance.
19+
320
## 5.x
421

522
### Laravel 9 required

0 commit comments

Comments
 (0)