Skip to content

Merge release 1.24.4 into 2.0.x - #245

Merged
DavidBadura merged 11 commits into
2.0.xfrom
1.24.x-merge-up-into-2.0.x_mxZsb44N
Nov 7, 2026
Merged

DavidBadura merged 11 commits into
2.0.xfrom
1.24.x-merge-up-into-2.0.x_mxZsb44N

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Release Notes for 1.24.4

1.24.x bugfix release (patch)

1.24.4

  • Total issues resolved: 0
  • Total pull requests resolved: 1
  • Total contributors: 1

bug

ArrayShapeNormalizer only returned the keys it had an inner normalizer for,
so every other key of the shape was silently dropped on extract and hydrate.
Keys holding null were dropped too because of isset(). The normalizer now
works on the given array and only converts the keys it has a normalizer for,
null included, and keeps everything else as it is, like ArrayNormalizer and
plain arrays do.
The collection branch unwrapped the nullable item type from the collection
itself instead of from the item type, so collections like list<?Skill> got no
normalizer at all and their items were passed through as raw objects.
An explicit ArrayShapeNormalizer map can contain keys that the property's
docblock shape doesn't know. handleType read those keys anyway and raised
undefined key warnings. Such fields are now left alone, like the whole map is
when the property type isn't an array shape.
The collection and array shape branches unwrapped nullable item types and
looked for a class normalizer before recursing, although inferNormalizerByType
does both on its own. Dropping the duplicate removes the place where the
nullable item bug came from. The shape branch is now also covered in the
metadata factory test.
The parameter names of mergeMetadata() were swapped relative to the call site,
so the lazy flag of the parent took precedence over the child's. A class with
#[Lazy(false)] extending a #[Lazy] class was still hydrated lazily. Everything
else keeps its current order: properties, callbacks and the data subject id of
the child still come first.
getMethods() already returns the public and protected methods a class inherits,
and mergeMetadata() added the parent's callbacks on top, so an inherited
#[PostHydrate] or #[PreExtract] method was called twice. An overridden one ran
as the child's version and then again as the parent's, because the parent's
reflection method was invoked directly. The merge now resolves every callback to
the method PHP would call on the child and keeps it once. An override runs as
the child's version, also when it doesn't repeat the attribute. Private methods
of the parent are not inherited and stay as they are.
The array and array shape examples used #[ArrayNormalizer] and
#[ArrayShapeNormalizer] without arguments, which fails because both constructors
require the inner normalizers. In these cases the normalizer is inferred from
the docblock, so the attribute is dropped and the text says so. A few other
examples had typos that made them invalid PHP, like a misspelled class name,
missing semicolons and a match arm written as a case.
Normalizers get null for nullable properties and, since the array shape fix,
for null values in shapes as well, so the example should not reject it.
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Author

Hello 👋

here is the most recent benchmark result:

HydratorBench
=============

+-------------------------------+------------------+------------------+-----------------+------------+
|                               | time (kde mode)                     | memory                       |
+-------------------------------+------------------+------------------+-----------------+------------+
| subject                       | Tag: <current>   | Tag: base        | Tag: <current>  | Tag: base  |
+-------------------------------+------------------+------------------+-----------------+------------+
| benchHydrate1Object ()        | 2.600μs (±0.00%) | 3.000μs (±0.00%) | 2.772mb         | 3.255mb    |
| benchExtract1Object ()        | 3.000μs (±0.00%) | 3.000μs (±0.00%) | 2.772mb         | 3.255mb    |
| benchHydrate1000Objects ()    | 1.928ms (±0.00%) | 1.983ms (±0.00%) | 2.948mb         | 3.340mb    |
| benchExtract1000Objects ()    | 1.805ms (±0.00%) | 1.835ms (±0.00%) | 2.876mb         | 3.340mb    |
| benchHydrate1000000Objects () | 1.042s (±0.00%)  | 1.066s (±0.00%)  | 2.948mb         | 3.340mb    |
| benchExtract1000000Objects () | 1.118s (±0.00%)  | 1.107s (±0.00%)  | 2.876mb         | 2.876mb    |
+-------------------------------+------------------+------------------+-----------------+------------+

HydratorWithCryptographyBench
=============================

+-------------------------------+-------------------+-------------------+-----------------+------------+
|                               | time (kde mode)                       | memory                       |
+-------------------------------+-------------------+-------------------+-----------------+------------+
| subject                       | Tag: <current>    | Tag: base         | Tag: <current>  | Tag: base  |
+-------------------------------+-------------------+-------------------+-----------------+------------+
| benchHydrate1Object ()        | 6.800μs (±0.00%)  | 6.400μs (±0.00%)  | 2.845mb         | 2.845mb    |
| benchExtract1Object ()        | 13.200μs (±0.00%) | 14.000μs (±0.00%) | 2.845mb         | 2.845mb    |
| benchHydrate1000Objects ()    | 3.386ms (±0.00%)  | 3.366ms (±0.00%)  | 3.094mb         | 3.094mb    |
| benchExtract1000Objects ()    | 6.613ms (±0.00%)  | 6.488ms (±0.00%)  | 3.199mb         | 3.199mb    |
| benchHydrate1000000Objects () | 1.913s (±0.00%)   | 1.900s (±0.00%)   | 3.094mb         | 3.094mb    |
| benchExtract1000000Objects () | 4.699s (±0.00%)   | 4.725s (±0.00%)   | 3.199mb         | 3.199mb    |
+-------------------------------+-------------------+-------------------+-----------------+------------+

StackHydratorBench
==================

+-------------------------------+------------------+------------------+-----------------+------------+
|                               | time (kde mode)                     | memory                       |
+-------------------------------+------------------+------------------+-----------------+------------+
| subject                       | Tag: <current>   | Tag: base        | Tag: <current>  | Tag: base  |
+-------------------------------+------------------+------------------+-----------------+------------+
| benchHydrate1Object ()        | 2.800μs (±0.00%) | 2.800μs (±0.00%) | 2.772mb         | 2.772mb    |
| benchExtract1Object ()        | 3.000μs (±0.00%) | 3.000μs (±0.00%) | 2.772mb         | 2.772mb    |
| benchHydrate1000Objects ()    | 1.958ms (±0.00%) | 1.969ms (±0.00%) | 2.948mb         | 2.948mb    |
| benchExtract1000Objects ()    | 1.750ms (±0.00%) | 1.795ms (±0.00%) | 2.876mb         | 2.876mb    |
| benchHydrate1000000Objects () | 1.038s (±0.00%)  | 1.041s (±0.00%)  | 2.948mb         | 2.948mb    |
| benchExtract1000000Objects () | 1.092s (±0.00%)  | 1.109s (±0.00%)  | 2.876mb         | 2.876mb    |
+-------------------------------+------------------+------------------+-----------------+------------+

StackHydratorWithCryptographyBench
==================================

+-------------------------------+-------------------+-------------------+-----------------+------------+
|                               | time (kde mode)                       | memory                       |
+-------------------------------+-------------------+-------------------+-----------------+------------+
| subject                       | Tag: <current>    | Tag: base         | Tag: <current>  | Tag: base  |
+-------------------------------+-------------------+-------------------+-----------------+------------+
| benchHydrate1Object ()        | 6.800μs (±0.00%)  | 7.000μs (±0.00%)  | 2.845mb         | 2.845mb    |
| benchExtract1Object ()        | 13.200μs (±0.00%) | 13.800μs (±0.00%) | 2.845mb         | 2.845mb    |
| benchHydrate1000Objects ()    | 3.431ms (±0.00%)  | 3.364ms (±0.00%)  | 3.094mb         | 3.094mb    |
| benchExtract1000Objects ()    | 6.581ms (±0.00%)  | 6.590ms (±0.00%)  | 3.199mb         | 3.199mb    |
| benchHydrate1000000Objects () | 1.891s (±0.00%)   | 1.911s (±0.00%)   | 3.094mb         | 3.094mb    |
| benchExtract1000000Objects () | 4.741s (±0.00%)   | 4.714s (±0.00%)   | 3.199mb         | 3.199mb    |
+-------------------------------+-------------------+-------------------+-----------------+------------+

HydratorWithLazyBench
=====================

+------------------------------------------+--------------------+--------------------+-----------------+------------+
|                                          | time (kde mode)                         | memory                       |
+------------------------------------------+--------------------+--------------------+-----------------+------------+
| subject                                  | Tag: <current>     | Tag: base          | Tag: <current>  | Tag: base  |
+------------------------------------------+--------------------+--------------------+-----------------+------------+
| benchHydrate1Object ()                   | 0.600μs (±0.00%)   | 0.400μs (±0.00%)   | 2.772mb         | 2.772mb    |
| benchHydrate1ObjectTriggerInit ()        | 3.000μs (±0.00%)   | 3.200μs (±0.00%)   | 2.772mb         | 2.772mb    |
| benchHydrate1000Objects ()               | 339.333μs (±0.00%) | 326.333μs (±0.00%) | 2.817mb         | 2.817mb    |
| benchHydrate1000ObjectsTriggerInit ()    | 2.609ms (±0.00%)   | 2.553ms (±0.00%)   | 2.865mb         | 2.865mb    |
| benchHydrate1000000Objects ()            | 206.811ms (±0.00%) | 212.222ms (±0.00%) | 2.817mb         | 2.817mb    |
| benchHydrate1000000ObjectsTriggerInit () | 1.607s (±0.00%)    | 1.656s (±0.00%)    | 2.865mb         | 2.865mb    |
+------------------------------------------+--------------------+--------------------+-----------------+------------+

This comment gets update everytime a new commit comes in!

@DavidBadura
DavidBadura merged commit b90b7c4 into 2.0.x Nov 7, 2026
16 checks passed
@DavidBadura
DavidBadura deleted the 1.24.x-merge-up-into-2.0.x_mxZsb44N branch November 7, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant