Skip to content

Commit 35470e5

Browse files
committed
release: version 2.2.0
1 parent ce1b0a2 commit 35470e5

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

docs/pages/project/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Below are listed the changelogs for all released versions of the library.
99

1010
## Version 2
1111

12+
- [`2.2.0` — 29th of September 2025](changelog/version-2.2.0.md)
1213
- [`2.1.2` — 28th of August 2025](changelog/version-2.1.2.md)
1314
- [`2.1.1` — 23rd of July 2025](changelog/version-2.1.1.md)
1415
- [`2.1.0` — 23rd of July 2025](changelog/version-2.1.0.md)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Changelog 2.2.0 — 29th of September 2025
2+
3+
!!! info inline end "[See release on GitHub]"
4+
[See release on GitHub]: https://github.com/CuyZ/Valinor/releases/tag/2.2.0
5+
6+
## Notable new features
7+
8+
**Mapping error messages improvements**
9+
10+
Feedback has been improved in mapping error messages, especially the expected
11+
signature of the failing nodes.
12+
13+
This gets rid of the infamous `?` that was used whenever an object was present
14+
in a type, leading to incomplete and misleading messages.
15+
16+
Example of a new message:
17+
18+
```php
19+
final class User
20+
{
21+
public function __construct(
22+
public string $name,
23+
public int $age,
24+
) {}
25+
}
26+
27+
(new MapperBuilder())
28+
->mapper()
29+
->map(User::class, 'invalid value');
30+
31+
// Could not map type `User`. An error occurred at path *root*: Value
32+
// 'invalid value' does not match `array{name: string, age: int}`.
33+
```
34+
35+
### Features
36+
37+
* Improve mapping error messages types signatures ([ce1b0a](https://github.com/CuyZ/Valinor/commit/ce1b0a294c5de3bf688290647b5dd5e5bbca1c77))
38+
39+
### Bug Fixes
40+
41+
* Prevent undefined values in `non-empty-list` ([9739cd](https://github.com/CuyZ/Valinor/commit/9739cd0598a21d092c4dae528e9b6fa70205fe47))
42+
* Properly detect nested invalid types during mapping ([ad756a](https://github.com/CuyZ/Valinor/commit/ad756aeb9aa30d0e72ce374e756f3d585848e0d1))
43+
* Use proper error message for invalid nullable scalar value ([b84cbe](https://github.com/CuyZ/Valinor/commit/b84cbec459deaf6e6a7d83726c26505848e4ebf9))
44+
45+
### Other
46+
47+
* Add safeguard in type parsing when reading next type ([da0de0](https://github.com/CuyZ/Valinor/commit/da0de013ecd92605f9c7d2ee4d465e805cdd6e5c))
48+
* Improve type parsing error when an unexpected token is found ([5ae904](https://github.com/CuyZ/Valinor/commit/5ae904414ac4660a7da079d074fdbae8dd3b80ba))
49+
* Lighten types initialization ([6f0b3f](https://github.com/CuyZ/Valinor/commit/6f0b3f162c5feb63444433f4313b8559697d3fc5))
50+
* Parse `iterable` type the same way it is done with `array` ([6291a7](https://github.com/CuyZ/Valinor/commit/6291a700eda0e7443cd5f64774f33d190296c2ad))
51+
* Rework how type traversing is used ([20f17f](https://github.com/CuyZ/Valinor/commit/20f17fbe75e787723e60b235b08cd8c0308900e6))
52+
* Set default exception error code to `unknown` ([c8ef49](https://github.com/CuyZ/Valinor/commit/c8ef491c2d694e05fbd1e6be247f7ff6fa89c3e0))

0 commit comments

Comments
 (0)