Skip to content

Commit 6311229

Browse files
committed
bug #46511 [Serializer] Added missing __call to TraceableNormalizer and TraceableSerializer (danielburger1337)
This PR was squashed before being merged into the 6.1 branch. Discussion ---------- [Serializer] Added missing __call to TraceableNormalizer and TraceableSerializer | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #46471 | License | MIT | Doc PR | none Added missing `__call` method to the new TraceableNormalizer and TraceableSerializer. This method was forgotten and breaks custom normalizers that have public methods outside of the NormalizerInterface. This approach is already being used for TreaceableAuthenticator, TraceableEventDispatcher, LoggingTranslator etc... Commits ------- 74f3c37 [Serializer] Added missing __call to TraceableNormalizer and TraceableSerializer
2 parents fe1759a + 74f3c37 commit 6311229

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Symfony/Component/Serializer/Debug/TraceableNormalizer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,12 @@ public function hasCacheableSupportsMethod(): bool
150150
{
151151
return $this->normalizer instanceof CacheableSupportsMethodInterface && $this->normalizer->hasCacheableSupportsMethod();
152152
}
153+
154+
/**
155+
* Proxies all method calls to the original normalizer.
156+
*/
157+
public function __call(string $method, array $arguments): mixed
158+
{
159+
return $this->normalizer->{$method}(...$arguments);
160+
}
153161
}

src/Symfony/Component/Serializer/Debug/TraceableSerializer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,12 @@ public function supportsDecoding(string $format, array $context = []): bool
165165
{
166166
return $this->serializer->supportsDecoding($format, $context);
167167
}
168+
169+
/**
170+
* Proxies all method calls to the original serializer.
171+
*/
172+
public function __call(string $method, array $arguments): mixed
173+
{
174+
return $this->serializer->{$method}(...$arguments);
175+
}
168176
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy