|
1 | 1 | # CHANGELOG |
2 | 2 |
|
| 3 | +## [v3.1.1] - 2025-11-05 |
| 4 | + |
| 5 | +### Fixed |
| 6 | + |
| 7 | +- Prevented fatal error caused by invalid enum value assignment in property resolution. |
| 8 | + |
3 | 9 | ## [v3.1.0] - 2025-10-29 |
4 | 10 |
|
5 | | -### ⚠️Note |
| 11 | +### ⚠️Note |
| 12 | + |
6 | 13 | > Starting from this release, the CHANGELOG will be maintained in English only.<br> |
7 | 14 | > 自本版本後僅提供英文版 CHANGELOG,不再提供中文版內容。 |
8 | 15 |
|
9 | 16 | ### Added |
10 | 17 |
|
11 | | -* Added `fromArray()` and `fromJson()` as new object construction entry points. |
| 18 | +- Added `fromArray()` and `fromJson()` as new object construction entry points. |
12 | 19 | Direct instantiation via `new` is no longer recommended. |
13 | | -* Added **Traditional Chinese documentation** `README_TW.md`, providing bilingual documentation and badges. |
14 | | -* Added **class-based object APIs**: `ReallifeKip\ImmutableBase\Objects\{DataTransferObject, ValueObject, Entity}`, allowing direct inheritance via `extends`. |
15 | | -* Added **Attributes namespace**: `ReallifeKip\ImmutableBase\Attributes\{DataTransferObject, ValueObject, Entity, ArrayOf}`. |
16 | | -* Added a set of **granular exception classes** (main ones listed): |
| 20 | +- Added **Traditional Chinese documentation** `README_TW.md`, providing bilingual documentation and badges. |
| 21 | +- Added **class-based object APIs**: `ReallifeKip\ImmutableBase\Objects\{DataTransferObject, ValueObject, Entity}`, allowing direct inheritance via `extends`. |
| 22 | +- Added **Attributes namespace**: `ReallifeKip\ImmutableBase\Attributes\{DataTransferObject, ValueObject, Entity, ArrayOf}`. |
| 23 | +- Added a set of **granular exception classes** (main ones listed): |
17 | 24 | `ImmutableBaseException`, `RuntimeException`, `LogicException`, |
18 | 25 | `InvalidTypeException`, `InvalidJsonException`, |
19 | 26 | `InvalidArrayException`, `InvalidArrayItemException`, `InvalidArrayValueException`, |
20 | 27 | `InvalidArrayOfClassException`, `InvalidPropertyVisibilityException`, |
21 | 28 | `AttributeException`, `InheritanceException`, `NonNullablePropertyException`. |
22 | | -* `with()` and `ArrayOf` now support automatic instantiation of array elements into specified classes. |
| 29 | +- `with()` and `ArrayOf` now support automatic instantiation of array elements into specified classes. |
23 | 30 | They accept **JSON strings, plain arrays, or existing instances** as input. |
24 | | -* Completed PHPDoc for the `toArrayOrValue()` core method. |
| 31 | +- Completed PHPDoc for the `toArrayOrValue()` core method. |
25 | 32 |
|
26 | 33 | ### Changed |
27 | 34 |
|
28 | | -* Refactored and simplified parts of the core logic in `src/ImmutableBase.php`. |
29 | | -* Extracted **Attributes** and **Objects** into separate namespaces to improve project structure and code readability. |
30 | | -* `with()` now supports modifying nested properties that are themselves subclasses of `ImmutableBase`, without requiring re-instantiation. |
31 | | -* Updated `composer.json` to include relevant keywords for better package discovery. |
| 35 | +- Refactored and simplified parts of the core logic in `src/ImmutableBase.php`. |
| 36 | +- Extracted **Attributes** and **Objects** into separate namespaces to improve project structure and code readability. |
| 37 | +- `with()` now supports modifying nested properties that are themselves subclasses of `ImmutableBase`, without requiring re-instantiation. |
| 38 | +- Updated `composer.json` to include relevant keywords for better package discovery. |
32 | 39 |
|
33 | 40 | ### Deprecated |
34 | 41 |
|
35 | | -* Direct instantiation (e.g., `new Example()`) **will be removed in v4.0.0**. |
| 42 | +- Direct instantiation (e.g., `new Example()`) **will be removed in v4.0.0**. |
36 | 43 | Please use `Example::fromArray()` or `Example::fromJson()` instead. |
37 | | -* `#[DataTransferObject]`, `#[ValueObject]`, and `#[Entity]` **will be deprecated in v4.0.0**. |
| 44 | +- `#[DataTransferObject]`, `#[ValueObject]`, and `#[Entity]` **will be deprecated in v4.0.0**. |
38 | 45 | Use the **class-based API** (`Objects\*`) going forward. |
39 | 46 |
|
40 | | - |
41 | 47 | ## [v3.0.3] - 2025-10-17 |
42 | 48 |
|
43 | 49 | - 修復 PHP 8.2 取得反射屬性名稱失敗 bug |
|
0 commit comments