@@ -8,6 +8,77 @@ toc_depth: 2
88All notable changes to this project will be documented in this file.
99<!-- - END HEADER -->
1010
11+ ## [ 0.14.0] ( https://github.com/CuyZ/Valinor/compare/0.13.0...0.14.0 ) (2022-09-01)
12+
13+ ### Notable changes
14+
15+ Until this release, the behaviour of the date objects creation was very
16+ opinionated: a huge list of date formats were tested out, and if one was working
17+ it was used to create the date.
18+
19+ This approach resulted in two problems. First, it led to (minor) performance
20+ issues, because a lot of date formats were potentially tested for nothing. More
21+ importantly, it was not possible to define which format(s) were to be allowed
22+ (and in result deny other formats).
23+
24+ A new method can now be used in the ` MapperBuilder ` :
25+
26+ ``` php
27+ (new \CuyZ\Valinor\MapperBuilder())
28+ // Both `Cookie` and `ATOM` formats will be accepted
29+ ->supportDateFormats(DATE_COOKIE, DATE_ATOM)
30+ ->mapper()
31+ ->map(DateTimeInterface::class, 'Monday, 08-Nov-1971 13:37:42 UTC');
32+ ```
33+
34+ Please note that the old behaviour has been removed. From now on, only valid
35+ timestamp or ATOM-formatted value will be accepted by default.
36+
37+ If needed and to help with the migration, the following ** deprecated**
38+ constructor can be registered to reactivate the previous behaviour:
39+
40+ ``` php
41+ (new \CuyZ\Valinor\MapperBuilder())
42+ ->registerConstructor(
43+ new \CuyZ\Valinor\Mapper\Object\BackwardCompatibilityDateTimeConstructor()
44+ )
45+ ->mapper()
46+ ->map(DateTimeInterface::class, 'Monday, 08-Nov-1971 13:37:42 UTC');
47+ ```
48+
49+ ### ⚠ BREAKING CHANGES
50+
51+ * Introduce constructor for custom date formats ([ f232cc] ( https://github.com/CuyZ/Valinor/commit/f232cc06363c447692e3df88129d0d31b506bccc ) )
52+
53+ ### Features
54+
55+ * Handle abstract constructor registration ([ c37ac1] ( https://github.com/CuyZ/Valinor/commit/c37ac1e25992d8b194b92d70e6a5727f71c665de ) )
56+ * Introduce attribute ` DynamicConstructor ` ([ e437d9] ( https://github.com/CuyZ/Valinor/commit/e437d9405cdff95b1cd9e644464fe38bf98ceb53 ) )
57+ * Introduce helper method to describe supported date formats ([ 11a7ea] ( https://github.com/CuyZ/Valinor/commit/11a7ea7252a788f8d9c075872dd82df78788aceb ) )
58+
59+ ### Bug Fixes
60+
61+ * Allow trailing comma in shaped array ([ bf445b] ( https://github.com/CuyZ/Valinor/commit/bf445b5364e11a91786b547ce14f3fe12043cf32 ) )
62+ * Correctly fetch file system cache entries ([ 48208c] ( https://github.com/CuyZ/Valinor/commit/48208c1ed1ffcc2ec93d9840b721ed6ce5a7670f ) )
63+ * Detect invalid constructor handle type ([ b3cb59] ( https://github.com/CuyZ/Valinor/commit/b3cb5927e9578b7519ef773abd0693d186ecaa68 ) )
64+ * Handle classes in a case-sensitive way in type parser ([ 254074] ( https://github.com/CuyZ/Valinor/commit/2540741171edce32ace1d59c9410a3bdd1e8e041 ) )
65+ * Handle concurrent cache file creation ([ fd39ae] ( https://github.com/CuyZ/Valinor/commit/fd39aea2a79f216f4e39de52aced905ed75ead0d ) )
66+ * Handle inherited private constructor in class definition ([ 73b622] ( https://github.com/CuyZ/Valinor/commit/73b62241b63ed365a90fb5e44876fafa63680177 ) )
67+ * Handle invalid nodes recursively ([ a401c2] ( https://github.com/CuyZ/Valinor/commit/a401c2a2d696b62d73f0bcccc7fe5b28180ccf99 ) )
68+ * Prevent illegal characters in PSR-16 cache keys ([ 3c4d29] ( https://github.com/CuyZ/Valinor/commit/3c4d29901af1419ca39bf05e7d7008c8fe0b5ae6 ) )
69+ * Properly handle callable objects of the same class ([ ae7ddc] ( https://github.com/CuyZ/Valinor/commit/ae7ddcf3caa77f2c4b4ad99dcdbb5f609de55335 ) )
70+
71+ ### Other
72+
73+ * Add singleton usage of ` ClassStringType ` ([ 4bc50e] ( https://github.com/CuyZ/Valinor/commit/4bc50e3e42d42798b266026827909b28b1ba8258 ) )
74+ * Change ` ObjectBuilderFactory::for ` return signature ([ 57849c] ( https://github.com/CuyZ/Valinor/commit/57849c92e736335ed2f6b9a50344a1a21dd3bc01 ) )
75+ * Extract native constructor object builder ([ 2b46a6] ( https://github.com/CuyZ/Valinor/commit/2b46a60f37966769e3694e743d92382c6e2f8842 ) )
76+ * Fetch attributes for function definition ([ ec494c] ( https://github.com/CuyZ/Valinor/commit/ec494cec489b18a2344796c105af55a33dc39ba0 ) )
77+ * Refactor arguments instantiation ([ 6414e9] ( https://github.com/CuyZ/Valinor/commit/6414e9cf14f5c4bb4337dc2c8f2bfa09b7048fd0 ) )
78+
79+
80+ ---
81+
1182## [ 0.13.0] ( https://github.com/CuyZ/Valinor/compare/0.12.0...0.13.0 ) (2022-07-31)
1283
1384### Notable changes
0 commit comments