You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Symfony\Component\Messenger\Transport\Serialization\Serializer, serializing and then deserializing some stamps, such as Symfony\Component\Messenger\Stamp\TransportNamesStamp fail due to the name of the getter not matching the name in the constructor.
How to reproduce
Use the serializer Symfony\Component\Messenger\Transport\Serialization\Serializer to serialize and deserialize this Stamp.
Possible Solution
Rename the variable name $transports to $transportNames in the constructor.
Additional Context
I will put out a PR myself.
The text was updated successfully, but these errors were encountered:
…ksaun)
This PR was merged into the 6.2 branch.
Discussion
----------
[Messenger] Fix `TransportNamesStamp` deserialization
| Q | A
| ------------- | ---
| Branch? | 6.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #49574, #31490 (comment)
| License | MIT
| Doc PR | n/a
Currently, when ones use `TransportNameStamp` the following exception can occur if they don't use native PHP serialization:
```
In Serializer.php line 125:
[Symfony\Component\Messenger\Exception\MessageDecodingFailedException]
Could not decode stamp: Cannot create an instance of "Symfony\Component\Messenger\Stamp\TransportNamesStamp" from serialized data because its constructor requires parameter "transports" to be present.
In AbstractNormalizer.php line 384:
[Symfony\Component\Serializer\Exception\MissingConstructorArgumentsException]
Cannot create an instance of "Symfony\Component\Messenger\Stamp\TransportNamesStamp" from serialized data because its constructor requires parameter "transports" to be present.
```
This PR renames `TransportNamesStamp` constructor argument in order to match the accessor method (`getTransportNames`) so that deserialization works when using the Serializer.
I know this is technically a (small) BC break but Symfony's BC does not cover named arguments if I remember correctly.
Commits
-------
2c7eee0 [Messenger] Fix TransportNamesStamp deserialization
Symfony version(s) affected
6.2, 6.3
Description
When using
Symfony\Component\Messenger\Transport\Serialization\Serializer
, serializing and then deserializing some stamps, such asSymfony\Component\Messenger\Stamp\TransportNamesStamp
fail due to the name of the getter not matching the name in the constructor.How to reproduce
Use the serializer
Symfony\Component\Messenger\Transport\Serialization\Serializer
to serialize and deserialize this Stamp.Possible Solution
Rename the variable name
$transports
to$transportNames
in the constructor.Additional Context
I will put out a PR myself.
The text was updated successfully, but these errors were encountered: