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
minor #50870 Add more details to the UPGRADE guide (wouterj)
This PR was merged into the 7.0 branch.
Discussion
----------
Add more details to the UPGRADE guide
| Q | A
| ------------- | ---
| Branch? | 7.0
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
322f23c Add more details to UPGRADE guide
* Passing null to `*Command::setApplication()`, `*FormatterStyle::setForeground/setBackground()`, `Helper::setHelpSet()`, `Input*::setDefault()` and `Question::setAutocompleterCallback/setValidator()` must be done explicitly
18
45
* Remove `StringInput::REGEX_STRING`
19
46
* Add method `__toString()` to `InputInterface`
@@ -128,17 +155,83 @@ Security
128
155
SecurityBundle
129
156
--------------
130
157
131
-
* Enabling SecurityBundle and not configuring it is not allowed
158
+
* Enabling SecurityBundle and not configuring it is not allowed, either remove the bundle or configure at least one firewall
132
159
133
160
Serializer
134
161
----------
135
162
136
163
* Add method `getSupportedTypes()` to `DenormalizerInterface` and `NormalizerInterface`
137
164
* Remove denormalization support for `AbstractUid` in `UidNormalizer`, use one of `AbstractUid` child class instead
138
165
* Denormalizing to an abstract class in `UidNormalizer` now throws an `\Error`
139
-
* Remove `ContextAwareDenormalizerInterface`, use `DenormalizerInterface` instead
140
-
* Remove `ContextAwareNormalizerInterface`, use `NormalizerInterface` instead
166
+
* Remove `ContextAwareDenormalizerInterface` and `ContextAwareNormalizerInterface`, use `DenormalizerInterface` and `NormalizerInterface` instead
167
+
168
+
*Before*
169
+
```php
170
+
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
171
+
172
+
class TopicNormalizer implements ContextAwareNormalizerInterface
173
+
{
174
+
public function normalize($topic, string $format = null, array $context = [])
175
+
{
176
+
}
177
+
}
178
+
```
179
+
180
+
*After*
181
+
```php
182
+
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
183
+
184
+
class TopicNormalizer implements NormalizerInterface
185
+
{
186
+
public function normalize($topic, string $format = null, array $context = [])
187
+
{
188
+
}
189
+
}
190
+
```
141
191
* Remove `CacheableSupportsMethodInterface`, use `NormalizerInterface` and `DenormalizerInterface` instead
192
+
193
+
*Before*
194
+
```php
195
+
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
196
+
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
197
+
198
+
class TopicNormalizer implements NormalizerInterface, CacheableSupportsMethodInterface
199
+
{
200
+
public function supportsNormalization($data, string $format = null, array $context = []): bool
201
+
{
202
+
return $data instanceof Topic;
203
+
}
204
+
205
+
public function hasCacheableSupportsMethod(): bool
206
+
{
207
+
return true;
208
+
}
209
+
210
+
// ...
211
+
}
212
+
```
213
+
214
+
*After*
215
+
```php
216
+
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
217
+
218
+
class TopicNormalizer implements NormalizerInterface
219
+
{
220
+
public function supportsNormalization($data, string $format = null, array $context = []): bool
221
+
{
222
+
return $data instanceof Topic;
223
+
}
224
+
225
+
public function getSupportedTypes(?string $format): array
226
+
{
227
+
return [
228
+
Topic::class => true,
229
+
];
230
+
}
231
+
232
+
// ...
233
+
}
234
+
```
142
235
* First argument of `AttributeMetadata::setSerializedName()` is now required
143
236
* Add argument `$context` to `NormalizerInterface::supportsNormalization()` and `DenormalizerInterface::supportsDenormalization()`
0 commit comments