Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdc7b171

Browse files
committed
[Serializer] Remove BC layer
1 parent2a2c825 commitdc7b171

File tree

38 files changed

+87
-492
lines changed

38 files changed

+87
-492
lines changed

‎.github/expected-missing-return-types.diff‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11875,24 +11875,24 @@ index b684fddb2f..ade2242791 100644
1187511875
{
1187611876
return $this->data;
1187711877
diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php
11878-
index079b1e7a9e..e3cfe43e67 100644
11878+
indexefe4a6e0e1..fbf291af7e 100644
1187911879
--- a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php
1188011880
+++ b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php
11881-
@@ -221,5 +221,5 @@ abstract class AbstractNormalizer implements NormalizerInterface, DenormalizerIn
11881+
@@ -211,5 +211,5 @@ abstract class AbstractNormalizer implements NormalizerInterface, DenormalizerIn
1188211882
* @throws LogicException if the 'allow_extra_attributes' context variable is false and no class metadata factory is provided
1188311883
*/
1188411884
- protected function getAllowedAttributes(string|object $classOrObject, array $context, bool $attributesAsString = false)
1188511885
+ protected function getAllowedAttributes(string|object $classOrObject, array $context, bool $attributesAsString = false): array|bool
1188611886
{
1188711887
$allowExtraAttributes = $context[self::ALLOW_EXTRA_ATTRIBUTES] ?? $this->defaultContext[self::ALLOW_EXTRA_ATTRIBUTES];
11888-
@@ -271,5 +271,5 @@ abstract class AbstractNormalizer implements NormalizerInterface, DenormalizerIn
11888+
@@ -261,5 +261,5 @@ abstract class AbstractNormalizer implements NormalizerInterface, DenormalizerIn
1188911889
* @return bool
1189011890
*/
1189111891
- protected function isAllowedAttribute(object|string $classOrObject, string $attribute, string $format = null, array $context = [])
1189211892
+ protected function isAllowedAttribute(object|string $classOrObject, string $attribute, string $format = null, array $context = []): bool
1189311893
{
1189411894
$ignoredAttributes = $context[self::IGNORED_ATTRIBUTES] ?? $this->defaultContext[self::IGNORED_ATTRIBUTES];
11895-
@@ -322,5 +322,5 @@ abstract class AbstractNormalizer implements NormalizerInterface, DenormalizerIn
11895+
@@ -312,5 +312,5 @@ abstract class AbstractNormalizer implements NormalizerInterface, DenormalizerIn
1189611896
* @throws MissingConstructorArgumentsException
1189711897
*/
1189811898
- protected function instantiateObject(array &$data, string $class, array &$context, \ReflectionClass $reflectionClass, array|bool $allowedAttributes, string $format = null)
@@ -11980,7 +11980,7 @@ index 48e8c3fb54..a71c3ea476 100644
1198011980
+ public function setDenormalizer(DenormalizerInterface $denormalizer): void;
1198111981
}
1198211982
diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php
11983-
index4edb70096d..8c844785db 100644
11983+
index7faa516980..cb1855c209 100644
1198411984
--- a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php
1198511985
+++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php
1198611986
@@ -47,5 +47,5 @@ interface DenormalizerInterface
@@ -11998,10 +11998,10 @@ index 4edb70096d..8c844785db 100644
1199811998

1199911999
/**
1200012000
diff --git a/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
12001-
index063d34ea59..fb10337d35 100644
12001+
index52a2daca91..99e06f844e 100644
1200212002
--- a/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
1200312003
+++ b/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
12004-
@@ -147,5 +147,5 @@ class GetSetMethodNormalizer extends AbstractObjectNormalizer
12004+
@@ -137,5 +137,5 @@ class GetSetMethodNormalizer extends AbstractObjectNormalizer
1200512005
* @return void
1200612006
*/
1200712007
- protected function setAttributeValue(object $object, string $attribute, mixed $value, string $format = null, array $context = [])
@@ -12030,7 +12030,7 @@ index 40a4fa0e8c..a1e2749aae 100644
1203012030
{
1203112031
$this->normalizer = $normalizer;
1203212032
diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php
12033-
index40779de316..105cf99b06 100644
12033+
indexb956e260b3..6382cde0c8 100644
1203412034
--- a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php
1203512035
+++ b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php
1203612036
@@ -39,5 +39,5 @@ interface NormalizerInterface
@@ -12048,21 +12048,21 @@ index 40779de316..105cf99b06 100644
1204812048

1204912049
/**
1205012050
diff --git a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php
12051-
index357c36426e..f4423f47f4 100644
12051+
index2e61947c28..6b604baa04 100644
1205212052
--- a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php
1205312053
+++ b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php
12054-
@@ -146,5 +146,5 @@ class ObjectNormalizer extends AbstractObjectNormalizer
12054+
@@ -136,5 +136,5 @@ class ObjectNormalizer extends AbstractObjectNormalizer
1205512055
* @return void
1205612056
*/
1205712057
- protected function setAttributeValue(object $object, string $attribute, mixed $value, string $format = null, array $context = [])
1205812058
+ protected function setAttributeValue(object $object, string $attribute, mixed $value, string $format = null, array $context = []): void
1205912059
{
1206012060
try {
1206112061
diff --git a/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php
12062-
indexec12db9bb2..d3b7f036a8 100644
12062+
index39810e10c9..57e2adbdd5 100644
1206312063
--- a/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php
1206412064
+++ b/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php
12065-
@@ -187,5 +187,5 @@ class PropertyNormalizer extends AbstractObjectNormalizer
12065+
@@ -177,5 +177,5 @@ class PropertyNormalizer extends AbstractObjectNormalizer
1206612066
* @return void
1206712067
*/
1206812068
- protected function setAttributeValue(object $object, string $attribute, mixed $value, string $format = null, array $context = [])

‎UPGRADE-7.0.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ Serializer
3131

3232
* Remove denormalization support for`AbstractUid` in`UidNormalizer`, use one of`AbstractUid` child class instead
3333
* Denormalizing to an abstract class in`UidNormalizer` now throws an`\Error`
34+
* Remove`ContextAwareDenormalizerInterface`, use`DenormalizerInterface` instead
35+
* Remove`ContextAwareNormalizerInterface`, use`NormalizerInterface` instead
36+
* Remove`CacheableSupportsMethodInterface`, use`NormalizerInterface` and`DenormalizerInterface` instead
37+
* First argument of`Symfony\Component\Validator\Mapping\ClassMetadata::setSerializedName()` is now required

‎src/Symfony/Component/Messenger/Transport/Serialization/Normalizer/FlattenExceptionNormalizer.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313

1414
useSymfony\Component\ErrorHandler\Exception\FlattenException;
1515
useSymfony\Component\Messenger\Transport\Serialization\Serializer;
16-
useSymfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
1716
useSymfony\Component\Serializer\Normalizer\DenormalizerInterface;
1817
useSymfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
18+
useSymfony\Component\Serializer\Normalizer\NormalizerInterface;
1919

2020
/**
2121
* This normalizer is only used in Debug/Dev/Messenger contexts.
2222
*
2323
* @author Pascal Luna <skalpa@zetareticuli.org>
2424
*/
25-
finalclass FlattenExceptionNormalizerimplements DenormalizerInterface,ContextAwareNormalizerInterface
25+
finalclass FlattenExceptionNormalizerimplements DenormalizerInterface,NormalizerInterface
2626
{
2727
use NormalizerAwareTrait;
2828

‎src/Symfony/Component/Serializer/CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ CHANGELOG
66

77
* Remove denormalization support for`AbstractUid` in`UidNormalizer`, use one of`AbstractUid` child class instead
88
* Denormalizing to an abstract class in`UidNormalizer` now throws an`\Error`
9+
* Remove`ContextAwareDenormalizerInterface`, use`DenormalizerInterface` instead
10+
* Remove`ContextAwareNormalizerInterface`, use`NormalizerInterface` instead
11+
* Remove`CacheableSupportsMethodInterface`, use`NormalizerInterface` and`DenormalizerInterface` instead
12+
* First argument of`Symfony\Component\Validator\Mapping\ClassMetadata::setSerializedName()` is now required
913

1014
6.3
1115
---

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

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespaceSymfony\Component\Serializer\Debug;
1313

1414
useSymfony\Component\Serializer\DataCollector\SerializerDataCollector;
15-
useSymfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
1615
useSymfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
1716
useSymfony\Component\Serializer\Normalizer\DenormalizerInterface;
1817
useSymfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
@@ -27,24 +26,16 @@
2726
*
2827
* @internal
2928
*/
30-
class TraceableNormalizerimplements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface, NormalizerAwareInterface, DenormalizerAwareInterface, CacheableSupportsMethodInterface
29+
class TraceableNormalizerimplements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface, NormalizerAwareInterface, DenormalizerAwareInterface
3130
{
3231
publicfunction__construct(
3332
privateNormalizerInterface|DenormalizerInterface$normalizer,
3433
privateSerializerDataCollector$dataCollector,
3534
) {
36-
if (!method_exists($normalizer,'getSupportedTypes')) {
37-
trigger_deprecation('symfony/serializer','6.3','Not implementing the "NormalizerInterface::getSupportedTypes()" in "%s" is deprecated.',get_debug_type($normalizer));
38-
}
3935
}
4036

4137
publicfunctiongetSupportedTypes(?string$format):array
4238
{
43-
// @deprecated remove condition in 7.0
44-
if (!method_exists($this->normalizer,'getSupportedTypes')) {
45-
return ['*' =>$this->normalizerinstanceof CacheableSupportsMethodInterface &&$this->normalizer->hasCacheableSupportsMethod()];
46-
}
47-
4839
return$this->normalizer->getSupportedTypes($format);
4940
}
5041

@@ -127,16 +118,6 @@ public function setDenormalizer(DenormalizerInterface $denormalizer): void
127118
$this->normalizer->setDenormalizer($denormalizer);
128119
}
129120

130-
/**
131-
* @deprecated since Symfony 6.3, use "getSupportedTypes()" instead
132-
*/
133-
publicfunctionhasCacheableSupportsMethod():bool
134-
{
135-
trigger_deprecation('symfony/serializer','6.3','The "%s()" method is deprecated, use "getSupportedTypes()" instead.',__METHOD__);
136-
137-
return$this->normalizerinstanceof CacheableSupportsMethodInterface &&$this->normalizer->hasCacheableSupportsMethod();
138-
}
139-
140121
/**
141122
* Proxies all method calls to the original normalizer.
142123
*/

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
useSymfony\Component\Serializer\DataCollector\SerializerDataCollector;
1515
useSymfony\Component\Serializer\Encoder\DecoderInterface;
1616
useSymfony\Component\Serializer\Encoder\EncoderInterface;
17-
useSymfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
1817
useSymfony\Component\Serializer\Normalizer\DenormalizerInterface;
1918
useSymfony\Component\Serializer\Normalizer\NormalizerInterface;
2019
useSymfony\Component\Serializer\SerializerInterface;
@@ -34,9 +33,6 @@ public function __construct(
3433
privateSerializerInterface&NormalizerInterface&DenormalizerInterface&EncoderInterface&DecoderInterface$serializer,
3534
privateSerializerDataCollector$dataCollector,
3635
) {
37-
if (!method_exists($serializer,'getSupportedTypes')) {
38-
trigger_deprecation('symfony/serializer','6.3','Not implementing the "NormalizerInterface::getSupportedTypes()" in "%s" is deprecated.',get_debug_type($serializer));
39-
}
4036
}
4137

4238
publicfunctionserialize(mixed$data,string$format,array$context = []):string
@@ -131,11 +127,6 @@ public function decode(string $data, string $format, array $context = []): mixed
131127

132128
publicfunctiongetSupportedTypes(?string$format):array
133129
{
134-
// @deprecated remove condition in 7.0
135-
if (!method_exists($this->serializer,'getSupportedTypes')) {
136-
return ['*' =>$this->serializerinstanceof CacheableSupportsMethodInterface &&$this->serializer->hasCacheableSupportsMethod()];
137-
}
138-
139130
return$this->serializer->getSupportedTypes($format);
140131
}
141132

‎src/Symfony/Component/Serializer/Mapping/AttributeMetadata.php‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,8 @@ public function getMaxDepth(): ?int
110110
return$this->maxDepth;
111111
}
112112

113-
publicfunctionsetSerializedName(string$serializedName =null):void
113+
publicfunctionsetSerializedName(?string$serializedName):void
114114
{
115-
if (1 >\func_num_args()) {
116-
trigger_deprecation('symfony/serializer','6.2','Calling "%s()" without any arguments is deprecated, pass null explicitly instead.',__METHOD__);
117-
}
118-
119115
$this->serializedName =$serializedName;
120116
}
121117

‎src/Symfony/Component/Serializer/Mapping/ClassMetadata.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,8 @@ public function getClassDiscriminatorMapping(): ?ClassDiscriminatorMapping
9090
return$this->classDiscriminatorMapping;
9191
}
9292

93-
publicfunctionsetClassDiscriminatorMapping(ClassDiscriminatorMapping$mapping =null):void
93+
publicfunctionsetClassDiscriminatorMapping(?ClassDiscriminatorMapping$mapping):void
9494
{
95-
if (1 >\func_num_args()) {
96-
trigger_deprecation('symfony/serializer','6.2','Calling "%s()" without any arguments is deprecated, pass null explicitly instead.',__METHOD__);
97-
}
9895
$this->classDiscriminatorMapping =$mapping;
9996
}
10097

‎src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* @author Kévin Dunglas <dunglas@gmail.com>
3030
*/
31-
abstractclass AbstractNormalizerimplements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface, CacheableSupportsMethodInterface
31+
abstractclass AbstractNormalizerimplements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface
3232
{
3333
use ObjectToPopulateTrait;
3434
use SerializerAwareTrait;
@@ -156,16 +156,6 @@ public function __construct(ClassMetadataFactoryInterface $classMetadataFactory
156156
}
157157
}
158158

159-
/**
160-
* @deprecated since Symfony 6.3, use "getSupportedTypes()" instead
161-
*/
162-
publicfunctionhasCacheableSupportsMethod():bool
163-
{
164-
trigger_deprecation('symfony/serializer','6.3','The "%s()" method is deprecated, use "getSupportedTypes()" instead.',__METHOD__);
165-
166-
returnfalse;
167-
}
168-
169159
/**
170160
* Detects if the configured circular reference limit is reached.
171161
*

‎src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@
2323
*
2424
* @final
2525
*/
26-
class ArrayDenormalizerimplementsContextAwareDenormalizerInterface, DenormalizerAwareInterface, CacheableSupportsMethodInterface
26+
class ArrayDenormalizerimplementsDenormalizerInterface, DenormalizerAwareInterface
2727
{
2828
use DenormalizerAwareTrait;
2929

3030
publicfunctionsetDenormalizer(DenormalizerInterface$denormalizer):void
3131
{
32-
if (!method_exists($denormalizer,'getSupportedTypes')) {
33-
trigger_deprecation('symfony/serializer','6.3','Not implementing the "DenormalizerInterface::getSupportedTypes()" in "%s" is deprecated.',get_debug_type($denormalizer));
34-
}
35-
3632
$this->denormalizer =$denormalizer;
3733
}
3834

@@ -82,14 +78,4 @@ public function supportsDenormalization(mixed $data, string $type, string $forma
8278
returnstr_ends_with($type,'[]')
8379
&&$this->denormalizer->supportsDenormalization($data,substr($type,0, -2),$format,$context);
8480
}
85-
86-
/**
87-
* @deprecated since Symfony 6.3, use "getSupportedTypes()" instead
88-
*/
89-
publicfunctionhasCacheableSupportsMethod():bool
90-
{
91-
trigger_deprecation('symfony/serializer','6.3','The "%s()" method is deprecated, use "getSupportedTypes()" instead.',__METHOD__);
92-
93-
return$this->denormalizerinstanceof CacheableSupportsMethodInterface &&$this->denormalizer->hasCacheableSupportsMethod();
94-
}
9581
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp