8000 [Serializer] fix compatibility with psalm v4 · symfony/symfony@d60423b · GitHub
[go: up one dir, main page]

Skip to content

Commit d60423b

Browse files
[Serializer] fix compatibility with psalm v4
1 parent 7e9e713 commit d60423b

File tree

4 files changed

+14
-34
lines changed

4 files changed

+14
-34
lines changed

src/Symfony/Component/Serializer/DataCollector/SerializerDataCollector.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
/**
2222
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
2323
*
24-
* @final
25-
*
2624
* @internal
2725
*/
2826
class SerializerDataCollector extends DataCollector implements LateDataCollectorInterface

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
*
2424
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
2525
*
26-
* @final
27-
*
2826
* @internal
2927
*/
3028
class TraceableEncoder implements EncoderInterface, DecoderInterface, SerializerAwareInterface

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
*
2626
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
2727
*
28-
* @final
29-
*
3028
* @internal
3129
*/
3230
class TraceableNormalizer implements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface, NormalizerAwareInterface, DenormalizerAwareInterface, CacheableSupportsMethodInterface

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

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,25 @@
2323
*
2424
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
2525
*
26-
* @final
2726
* @internal
2827
*/
2928
class TraceableSerializer implements SerializerInterface, NormalizerInterface, DenormalizerInterface, EncoderInterface, DecoderInterface
3029
{
3130
public const DEBUG_TRACE_ID = 'debug_trace_id';
3231

32+
/**
33+
* @param SerializerInterface&NormalizerInterface&DenormalizerInterface&EncoderInterface&DecoderInterface $serializer
34+
*/
3335
public function __construct(
34-
private SerializerInterface&NormalizerInterface&DenormalizerInterface&EncoderInterface&DecoderInterface $serializer,
36+
private SerializerInterface $serializer,
3537
private SerializerDataCollector $dataCollector,
3638
) {
3739
}
3840

3941
/**
4042
* {@inheritdoc}
4143
*/
42-
final public function serialize(mixed $data, string $format, array $context = []): string
44+
public function serialize(mixed $data, string $format, array $context = []): string
4345
{
4446
$context[self::DEBUG_TRACE_ID] = $traceId = uniqid();
4547

@@ -55,7 +57,7 @@ final public function serialize(mixed $data, string $format, array $context = []
5557
/**
5658
* {@inheritdoc}
5759
*/
58-
final public function deserialize(mixed $data, string $type, string $format, array $context = []): mixed
60+
public function deserialize(mixed $data, string $type, string $format, array $context = []): mixed
5961
{
6062
$context[self::DEBUG_TRACE_ID] = $traceId = uniqid();
6163

@@ -71,7 +73,7 @@ final public function deserialize(mixed $data, string $type, string $format, arr
7173
/**
7274
* {@inheritdoc}
7375
*/
74-
final public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
76+
public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
7577
{
7678
$context[self::DEBUG_TRACE_ID] = $traceId = uniqid();
7779

@@ -87,7 +89,7 @@ final public function normalize(mixed $object, string $format = null, array $con
8789
/**
8890
* {@inheritdoc}
8991
*/
90-
final public function denormalize(mixed $data, string $type, string $format = null, array $context 57AE = []): mixed
92+
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
9193
{
9294
$context[self::DEBUG_TRACE_ID] = $traceId = uniqid();
9395

@@ -103,7 +105,7 @@ final public function denormalize(mixed $data, string $type, string $format = nu
103105
/**
104106
* {@inheritdoc}
105107
*/
106-
final public function encode(mixed $data, string $format, array $context = []): string
108+
public function encode(mixed $data, string $format, array $context = []): string
107109
{
108110
$context[self::DEBUG_TRACE_ID] = $traceId = uniqid();
109111

@@ -119,7 +121,7 @@ final public function encode(mixed $data, string $format, array $context = []):
119121
/**
120122
* {@inheritdoc}
121123
*/
122-
final public function decode(string $data, string $format, array $context = []): mixed
124+
public function decode(string $data, string $format, array $context = []): mixed
123125
{
124126
$context[self::DEBUG_TRACE_ID] = $traceId = uniqid();
125127

@@ -134,49 +136,33 @@ final public function decode(string $data, string $format, array $context = []):
134136

135137
/**
136138
* {@inheritdoc}
137-
*
138-
* @param array $context
139139
*/
140-
final public function supportsNormalization(mixed $data, string $format = null /*, array $context = [] */): bool
140+
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
141141
{
142-
$context = \func_num_args() > 2 ? \func_get_arg(2) : [];
143-
144142
return $this->serializer->supportsNormalization($data, $format, $context);
145143
}
146144

147145
/**
148146
* {@inheritdoc}
149-
*
150-
* @param array $context
151147
*/
152-
final public function supportsDenormalization(mixed $data, string $type, string $format = null /*, array $context = [] */): bool
148+
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
153149
{
154-
$context = \func_num_args() > 3 ? \func_get_arg(3) : [];
155-
156150
return $this->serializer->supportsDenormalization($data, $type, $format, $context);
157151
}
158152

159153
/**
160154
* {@inheritdoc}
161-
*
162-
* @param array $context
163155
*/
164-
final public function supportsEncoding(string $format /*, array $context = [] */): bool
156+
public function supportsEncoding(string $format, array $context = []): bool
165157
{
166-
$context = \func_num_args() > 1 ? \func_get_arg(1) : [];
167-
168158
return $this->serializer->supportsEncoding($format, $context);
169159
}
170160

171161
/**
172162
* {@inheritdoc}
173-
*
174-
* @param array $context
175163
*/
176-
final public function supportsDecoding(string $format /*, array $context = [] */): bool
164+
public function supportsDecoding(string $format, array $context = []): bool
177165
{
178-
$context = \func_num_args() > 1 ? \func_get_arg(1) : [];
179-
180166
return $this->serializer->supportsDecoding($format, $context);
181167
}
182168
}

0 commit comments

Comments
 (0)
0