Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 649 lines (476 sloc) 19.869 kb
6b601bd @jfsimon [http-foudation] Better accept header parsing
jfsimon authored
1 UPGRADE FROM 2.1 to 2.2
2 =======================
3
64d43c8 @fabpot restricted to only URIs the first argument of the render tag
fabpot authored
4 ### TwigBridge
5
6 * The `render` tag signature and arguments changed.
7
8 Before:
9
10 ```
11 {% render 'BlogBundle:Post:list' with { 'limit': 2 }, { 'alt': 'BlogBundle:Post:error' } %}
12 ```
13
14 After:
15
16 ```
76fefe3 @fabpot updated CHANGELOG and UPGRADE files
fabpot authored
17 {% render controller('BlogBundle:Post:list', { 'limit': 2 }), { 'alt': 'BlogBundle:Post:error' } %}
9718c76 @lyrixx Updated UPGRADE-2.2.md for twig bridge section
lyrixx authored
18 {# Or: #}
19 {{ render(controller('BlogBundle:Post:list', { 'limit': 2 }), { 'alt': 'BlogBundle:Post:error'}) }}
64d43c8 @fabpot restricted to only URIs the first argument of the render tag
fabpot authored
20 ```
21
9718c76 @lyrixx Updated UPGRADE-2.2.md for twig bridge section
lyrixx authored
22 Note: The function is the preferred way.
23
caf288c @aitboudad [TwigBridge] render Deprecated option 'standalone' in favor of 'strat…
aitboudad authored
24 #### Deprecations
25
780f463 @inmarelibero fixed typo
inmarelibero authored
26 * The `standalone` option is deprecated and will be replaced with the `strategy` option in 2.3.
caf288c @aitboudad [TwigBridge] render Deprecated option 'standalone' in favor of 'strat…
aitboudad authored
27 * The values `true`, `false`, `js` for the `standalone` option were deprecated and replaced respectively with the `esi`, `inline`, `hinclude` in 2.3.
28
29
30 Before:
31
32 ```
33 {% render 'BlogBundle:Post:list' with { 'limit': 2 }, {'standalone': true} %}
34 {% render 'BlogBundle:Post:list' with { 'limit': 2 }, {'standalone': false} %}
35 {% render 'BlogBundle:Post:list' with { 'limit': 2 }, {'standalone': 'js'} %}
36 ```
37
38 After:
39
40 ```
41 {{ render(controller('BlogBundle:Post:list', { 'limit': 2 }), { 'strategy': 'esi'}) }}
42 {{ render(controller('BlogBundle:Post:list', { 'limit': 2 }), { 'strategy': 'inline'}) }}
43 {{ render(controller('BlogBundle:Post:list', { 'limit': 2 }), { 'strategy': 'hinclude'}) }}
44 ```
45
46
ded3a83 @jmikola [HttpFoundation] Document MongoDbSessionHandler changes
jmikola authored
47 ### HttpFoundation
48
49 * The MongoDbSessionHandler default field names and timestamp type have changed.
50
51 The `sess_` prefix was removed from default field names. The session ID is
52 now stored in the `_id` field by default. The session date is now stored as a
53 `MongoDate` instead of `MongoTimestamp`, which also makes it possible to use
54 TTL collections in MongoDB 2.2+ instead of relying on the `gc()` method.
55
bdf0334 @dlsniper Fixed the lap method. Added upgrade notes. Some CS fixes
dlsniper authored
56 * The Stopwatch functionality was moved from HttpKernel\Debug to its own component
57
0a380cf @fabpot [HttpFoundation] disabled Request _method feature by default (should …
fabpot authored
58 * The _method request parameter support has been disabled by default (call
59 Request::enableHttpMethodParameterOverride() to enable it).
60
6b601bd @jfsimon [http-foudation] Better accept header parsing
jfsimon authored
61 #### Deprecations
62
63 * The `Request::splitHttpAcceptHeader()` is deprecated and will be removed in 2.3.
64
65 You should now use the `AcceptHeader` class which give you fluent methods to
66 parse request accept-* headers. Some examples:
67
68 ```
69 $accept = AcceptHeader::fromString($request->headers->get('Accept'));
70 if ($accept->has('text/html') {
71 $item = $accept->get('html');
72 $charset = $item->getAttribute('charset', 'utf-8');
73 $quality = $item->getQuality();
74 }
75
76 // accepts items are sorted by descending quality
77 $accepts = AcceptHeader::fromString($request->headers->get('Accept'))->all();
78
79 ```
97f6a1b @egeloen [Form] Update password type trimming to false
egeloen authored
80
81 ### Form
82
fb71964 @webmozart [Form] Added an alternative signature Form::add($name, $type, $options)
webmozart authored
83 * The PasswordType is now not trimmed by default.
84
bcc5552 @webmozart [Form] Protected methods in FormConfigBuilder and FormBuilder from be…
webmozart authored
85 * The class FormException is now an interface. The old class is still available
86 under the name Symfony\Component\Form\Exception\Exception, but will probably
87 be removed before 2.2. If you created FormException instances manually,
88 you are now advised to create any of the other exceptions in the
89 Symfony\Component\Form\Exception namespace or to create custom exception
90 classes for your purpose.
91
1e34e91 @webmozart [Form] Added upgrade instructions to the UPGRADE file
webmozart authored
92 * Translating validation errors is now optional. You can still do so
93 manually if you like, or you can simplify your templates to simply output
94 the already translated message.
95
96 Before:
97
98 ```
99 {{
100 error.messagePluralization is null
101 ? error.messageTemplate|trans(error.messageParameters, 'validators')
102 : error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators')
103 }}
104 ```
105
106 After:
107
108 ```
109 {{ error.message }}
110 ```
111
1bae7b2 @webmozart [PropertyAccess] Extracted PropertyAccess component out of Form
webmozart authored
112 * FormType, ModelType and PropertyPathMapper now have constructors. If you
113 extended these classes, you should call the parent constructor now.
114 Note that you are not recommended to extend FormType nor ModelType. You should
115 extend AbstractType instead and use the Form component's own inheritance
116 mechanism (`AbstractType::getParent()`).
117
118 Before:
119
120 ```
121 use Symfony\Component\Form\Extensions\Core\DataMapper\PropertyPathMapper;
122
123 class CustomMapper extends PropertyPathMapper
124 {
125 public function __construct()
126 {
127 // ...
128 }
129
130 // ...
131 }
132 ```
133
134 After:
135
136 ```
137 use Symfony\Component\Form\Extensions\Core\DataMapper\PropertyPathMapper;
138
139 class CustomMapper extends PropertyPathMapper
140 {
141 public function __construct()
142 {
143 parent::__construct();
144
145 // ...
146 }
147
148 // ...
149 }
150 ```
151
fb71964 @webmozart [Form] Added an alternative signature Form::add($name, $type, $options)
webmozart authored
152 #### Deprecations
153
154 * The methods `getParent()`, `setParent()` and `hasParent()` in
155 `FormBuilderInterface` were deprecated and will be removed in Symfony 2.3.
156 You should not rely on these methods in your form type because the parent
157 of a form can change after building it.
24c6530 @webmozart [Validator] Added instructions on integrating the latest Validator ch…
webmozart authored
158
1bae7b2 @webmozart [PropertyAccess] Extracted PropertyAccess component out of Form
webmozart authored
159 * The class PropertyPath and related classes were deprecated and moved to a
160 dedicated component PropertyAccess. If you used any of these classes or
161 interfaces, you should adapt the namespaces now. During the move,
162 InvalidPropertyException was renamed to NoSuchPropertyException.
163
164 Before:
165
166 ```
167 use Symfony\Component\Form\Util\PropertyPath;
168 use Symfony\Component\Form\Util\PropertyPathBuilder;
169 use Symfony\Component\Form\Util\PropertyPathInterface;
170 use Symfony\Component\Form\Util\PropertyPathIterator;
171 use Symfony\Component\Form\Util\PropertyPathIteratorInterface;
172 use Symfony\Component\Form\Exception\InvalidPropertyException;
173 use Symfony\Component\Form\Exception\InvalidPropertyPathException;
174 use Symfony\Component\Form\Exception\PropertyAccessDeniedException;
175 ```
176
177 After:
178
179 ```
180 use Symfony\Component\PropertyAccess\PropertyPath;
181 use Symfony\Component\PropertyAccess\PropertyPathBuilder;
182 use Symfony\Component\PropertyAccess\PropertyPathInterface;
183 use Symfony\Component\PropertyAccess\PropertyPathIterator;
184 use Symfony\Component\PropertyAccess\PropertyPathIteratorInterface;
185 use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException;
186 use Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException;
187 use Symfony\Component\PropertyAccess\Exception\PropertyAccessDeniedException;
188 ```
189
190 Also, `FormUtil::singularify()` was split away into a class StringUtil
191 in the new component.
192
193 Before:
194
195 ```
196 use Symfony\Component\Form\Util\FormUtil;
197
198 $singular = FormUtil::singularify($plural);
199 ```
200
201 After:
202
203 ```
204 use Symfony\Component\PropertyAccess\StringUtil;
205
206 $singular = StringUtil::singularify($plural);
207 ```
208
209 The methods `getValue()` and `setValue()` were moved to a new class
210 PropertyAccessor.
211
212 Before:
213
214 ```
215 use Symfony\Component\Form\Util\PropertyPath;
216
217 $propertyPath = new PropertyPath('some.path');
218
219 $value = $propertyPath->getValue($object);
220 $propertyPath->setValue($object, 'new value');
221 ```
222
223 After (alternative 1):
224
225 ```
226 use Symfony\Component\PropertyAccess\PropertyAccess;
227
ac0c4ce @WouterJ Fixed typo in UPGRADE-2.2
WouterJ authored
228 $propertyAccessor = PropertyAccess::getPropertyAccessor();
1bae7b2 @webmozart [PropertyAccess] Extracted PropertyAccess component out of Form
webmozart authored
229
230 $value = $propertyAccessor->getValue($object, 'some.path');
ac0c4ce @WouterJ Fixed typo in UPGRADE-2.2
WouterJ authored
231 $propertyAccessor->setValue($object, 'some.path', 'new value');
1bae7b2 @webmozart [PropertyAccess] Extracted PropertyAccess component out of Form
webmozart authored
232 ```
233
234 After (alternative 2):
235
236 ```
237 use Symfony\Component\PropertyAccess\PropertyAccess;
238 use Symfony\Component\PropertyAccess\PropertyPath;
239
ac0c4ce @WouterJ Fixed typo in UPGRADE-2.2
WouterJ authored
240 $propertyAccessor = PropertyAccess::getPropertyAccessor();
1bae7b2 @webmozart [PropertyAccess] Extracted PropertyAccess component out of Form
webmozart authored
241 $propertyPath = new PropertyPath('some.path');
242
243 $value = $propertyAccessor->getValue($object, $propertyPath);
ac0c4ce @WouterJ Fixed typo in UPGRADE-2.2
WouterJ authored
244 $propertyAccessor->setValue($object, $propertyPath, 'new value');
1bae7b2 @webmozart [PropertyAccess] Extracted PropertyAccess component out of Form
webmozart authored
245 ```
246
51223c0 @Tobion added upgrade instructions
Tobion authored
247 ### Routing
248
249 * RouteCollection does not behave like a tree structure anymore but as a flat
250 array of Routes. So when using PHP to build the RouteCollection, you must
251 make sure to add routes to the sub-collection before adding it to the parent
252 collection (this is not relevant when using YAML or XML for Route definitions).
253
254 Before:
255
256 ```
257 $rootCollection = new RouteCollection();
258 $subCollection = new RouteCollection();
259 $rootCollection->addCollection($subCollection);
260 $subCollection->add('foo', new Route('/foo'));
261 ```
262
263 After:
264
265 ```
266 $rootCollection = new RouteCollection();
267 $subCollection = new RouteCollection();
268 $subCollection->add('foo', new Route('/foo'));
269 $rootCollection->addCollection($subCollection);
270 ```
271
272 Also one must call `addCollection` from the bottom to the top hierarchy.
273 So the correct sequence is the following (and not the reverse):
274
275 ```
c9e8ee1 @kriswallsmith fixed typo
kriswallsmith authored
276 $childCollection->addCollection($grandchildCollection);
51223c0 @Tobion added upgrade instructions
Tobion authored
277 $rootCollection->addCollection($childCollection);
278 ```
279
280 * The methods `RouteCollection::getParent()` and `RouteCollection::getRoot()`
281 have been deprecated and will be removed in Symfony 2.3.
8c7a169 @Tobion [Routing] clean up of RouteCollection API
Tobion authored
282 * Misusing the `RouteCollection::addPrefix` method to add defaults, requirements
283 or options without adding a prefix is not supported anymore. So if you called `addPrefix`
284 with an empty prefix or `/` only (both have no relevance), like
285 `addPrefix('', $defaultsArray, $requirementsArray, $optionsArray)`
286 you need to use the new dedicated methods `addDefaults($defaultsArray)`,
287 `addRequirements($requirementsArray)` or `addOptions($optionsArray)` instead.
288 * The `$options` parameter to `RouteCollection::addPrefix()` has been deprecated
289 because adding options has nothing to do with adding a path prefix. If you want to add options
290 to all child routes of a RouteCollection, you can use `addOptions()`.
291 * The method `RouteCollection::getPrefix()` has been deprecated
292 because it suggested that all routes in the collection would have this prefix, which is
293 not necessarily true. On top of that, since there is no tree structure anymore, this method
294 is also useless.
295 * `RouteCollection::addCollection(RouteCollection $collection)` should now only be
296 used with a single parameter. The other params `$prefix`, `$default`, `$requirements` and `$options`
297 will still work, but have been deprecated. The `addPrefix` method should be used for this
298 use-case instead.
299 Before: `$parentCollection->addCollection($collection, '/prefix', array(...), array(...))`
300 After:
301 ```
302 $collection->addPrefix('/prefix', array(...), array(...));
303 $parentCollection->addCollection($collection);
304 ```
51223c0 @Tobion added upgrade instructions
Tobion authored
305
24c6530 @webmozart [Validator] Added instructions on integrating the latest Validator ch…
webmozart authored
306 ### Validator
307
1db6f05 @ragtek Update UPGRADE-2.2.md
ragtek authored
308 * Interfaces were created for the classes `ConstraintViolation`,
24c6530 @webmozart [Validator] Added instructions on integrating the latest Validator ch…
webmozart authored
309 `ConstraintViolationList`, `GlobalExecutionContext` and `ExecutionContext`.
310 If you type hinted against any of these classes, you are recommended to
311 type hint against their interfaces now.
312
313 Before:
314
315 ```
316 use Symfony\Component\Validator\ExecutionContext;
317
318 public function validateCustomLogic(ExecutionContext $context)
319 ```
320
321 After:
322
323 ```
fae3e35 @fabpot fixed typo
fabpot authored
324 use Symfony\Component\Validator\ExecutionContextInterface;
24c6530 @webmozart [Validator] Added instructions on integrating the latest Validator ch…
webmozart authored
325
326 public function validateCustomLogic(ExecutionContextInterface $context)
327 ```
328
329 For all implementations of `ConstraintValidatorInterface`, this change is
330 mandatory for the `initialize` method:
331
332 Before:
333
334 ```
335 use Symfony\Component\Validator\ConstraintValidatorInterface;
336 use Symfony\Component\Validator\ExecutionContext;
337
338 class MyValidator implements ConstraintValidatorInterface
339 {
340 public function initialize(ExecutionContext $context)
341 {
342 // ...
343 }
344 }
345 ```
346
347 After:
348
349 ```
350 use Symfony\Component\Validator\ConstraintValidatorInterface;
351 use Symfony\Component\Validator\ExecutionContextInterface;
352
353 class MyValidator implements ConstraintValidatorInterface
354 {
355 public function initialize(ExecutionContextInterface $context)
356 {
357 // ...
358 }
359 }
360 ```
361
cc0df0a @webmozart [Validator] Changed validator to support pluralized messages by default
webmozart authored
362 * The sources of the pluralized messages in translation files have changed
363 from the singular to the pluralized version. If you created custom
364 translation files for validator errors, you should adapt them.
365
366 Before:
367
368 <trans-unit id="6">
369 <source>You must select at least {{ limit }} choices.</source>
370 <target>Sie müssen mindestens {{ limit }} Möglichkeit wählen.|Sie müssen mindestens {{ limit }} Möglichkeiten wählen.</target>
371 </trans-unit>
372
373 After:
374
375 <trans-unit id="6">
376 <source>You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.</source>
377 <target>Sie müssen mindestens {{ limit }} Möglichkeit wählen.|Sie müssen mindestens {{ limit }} Möglichkeiten wählen.</target>
378 </trans-unit>
379
380 Check the file src/Symfony/Component/Validator/Resources/translations/validators.en.xlf
381 for the new message sources.
382
24c6530 @webmozart [Validator] Added instructions on integrating the latest Validator ch…
webmozart authored
383 #### Deprecations
384
385 * The interface `ClassMetadataFactoryInterface` was deprecated and will be
386 removed in Symfony 2.3. You should implement `MetadataFactoryInterface`
387 instead, which changes the name of the method `getClassMetadata` to
388 `getMetadataFor` and accepts arbitrary values (e.g. class names, objects,
389 numbers etc.). In your implementation, you should throw a
390 `NoSuchMetadataException` if you don't support metadata for the given value.
391
392 Before:
393
394 ```
395 use Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface;
396
397 class MyMetadataFactory implements ClassMetadataFactoryInterface
398 {
399 public function getClassMetadata($class)
400 {
401 // ...
402 }
403 }
404 ```
405
406 After:
407
408 ```
409 use Symfony\Component\Validator\MetadataFactoryInterface;
410 use Symfony\Component\Validator\Exception\NoSuchMetadataException;
411
412 class MyMetadataFactory implements MetadataFactoryInterface
413 {
414 public function getMetadataFor($value)
415 {
416 if (is_object($value)) {
417 $value = get_class($value);
418 }
419
420 if (!is_string($value) || (!class_exists($value) && !interface_exists($value))) {
421 throw new NoSuchMetadataException(...);
422 }
423
424 // ...
425 }
426 }
427 ```
428
429 The return value of `ValidatorInterface::getMetadataFactory()` was also
430 changed to return `MetadataFactoryInterface`. Make sure to replace calls to
431 `getClassMetadata` by `getMetadataFor` on the return value of this method.
432
433 Before:
434
435 ```
436 $metadataFactory = $validator->getMetadataFactory();
437 $metadata = $metadataFactory->getClassMetadata('Vendor\MyClass');
438 ```
439
440 After:
441
442 ```
443 $metadataFactory = $validator->getMetadataFactory();
444 $metadata = $metadataFactory->getMetadataFor('Vendor\MyClass');
445 ```
446
447 * The class `GraphWalker` and the accessor `ExecutionContext::getGraphWalker()`
448 were deprecated and will be removed in Symfony 2.3. You should use the
449 methods `ExecutionContextInterface::validate()` and
450 `ExecutionContextInterface::validateValue()` instead.
451
452 Before:
453
454 ```
455 use Symfony\Component\Validator\ExecutionContext;
456
457 public function validateCustomLogic(ExecutionContext $context)
458 {
459 if (/* ... */) {
460 $path = $context->getPropertyPath();
461 $group = $context->getGroup();
462
463 if (!empty($path)) {
464 $path .= '.';
465 }
466
7c47e34 @canni [CS Fix] Consistent coding-style of concatenation operator usage
canni authored
467 $context->getGraphWalker()->walkReference($someObject, $group, $path.'myProperty', false);
24c6530 @webmozart [Validator] Added instructions on integrating the latest Validator ch…
webmozart authored
468 }
469 }
470 ```
471
472 After:
473
474 ```
475 use Symfony\Component\Validator\ExecutionContextInterface;
476
477 public function validateCustomLogic(ExecutionContextInterface $context)
478 {
479 if (/* ... */) {
480 $context->validate($someObject, 'myProperty');
481 }
482 }
483 ```
484
c27cd09 @fabpot added missing method in the UPGRADE file for 2.2 (closes #8941)
fabpot authored
485 * The methods `ExecutionContext::addViolationAtSubPath()` and
486 `ExecutionContext::addViolationAtPath()` were deprecated and will be
487 removed in Symfony 2.3. You should use `addViolationAt()` instead.
24c6530 @webmozart [Validator] Added instructions on integrating the latest Validator ch…
webmozart authored
488
489 Before:
490
491 ```
492 use Symfony\Component\Validator\ExecutionContext;
493
494 public function validateCustomLogic(ExecutionContext $context)
495 {
496 if (/* ... */) {
497 $context->addViolationAtSubPath('myProperty', 'This value is invalid');
498 }
499 }
500 ```
501
502 After:
503
504 ```
505 use Symfony\Component\Validator\ExecutionContextInterface;
506
507 public function validateCustomLogic(ExecutionContextInterface $context)
508 {
509 if (/* ... */) {
510 $context->addViolationAt('myProperty', 'This value is invalid');
511 }
512 }
513 ```
514
515 * The methods `ExecutionContext::getCurrentClass()`, `ExecutionContext::getCurrentProperty()`
516 and `ExecutionContext::getCurrentValue()` were deprecated and will be removed
517 in Symfony 2.3. Use the methods `getClassName()`, `getPropertyName()` and
518 `getValue()` instead.
519
520 Before:
521
522 ```
523 use Symfony\Component\Validator\ExecutionContext;
524
525 public function validateCustomLogic(ExecutionContext $context)
526 {
527 $class = $context->getCurrentClass();
528 $property = $context->getCurrentProperty();
529 $value = $context->getCurrentValue();
530
531 // ...
532 }
533 ```
534
535 After:
536
537 ```
538 use Symfony\Component\Validator\ExecutionContextInterface;
539
540 public function validateCustomLogic(ExecutionContextInterface $context)
541 {
542 $class = $context->getClassName();
543 $property = $context->getPropertyName();
544 $value = $context->getValue();
545
546 // ...
547 }
548 ```
9071676 @ricardclau create oneof constraint and add deprecation messages in choice, also …
ricardclau authored
549
4d40b11 @benja-M-1 Add notes about kernel.trusted_proxies parameter
benja-M-1 authored
550 ### FrameworkBundle
551
3341c8e @fabpot [FrameworkBundle] restricted to only URIs the first argument of the a…
fabpot authored
552 * The `render` method of the `actions` templating helper signature and arguments changed:
553
554 Before:
555
556 ```
557 <?php echo $view['actions']->render('BlogBundle:Post:list', array('limit' => 2), array('alt' => 'BlogBundle:Post:error')) ?>
558 ```
559
560 After:
561
562 ```
563 <?php echo $view['actions']->render($view['router']->generate('post_list', array('limit' => 2)), array('alt' => 'BlogBundle:Post:error')) ?>
564 ```
565
76fefe3 @fabpot updated CHANGELOG and UPGRADE files
fabpot authored
566 where `post_list` is the route name for the `BlogBundle:Post:list`
567 controller, or if you don't want to create a route:
568
569 ```
570 <?php echo $view['actions']->render(new ControllerReference('BlogBundle:Post:list', array('limit' => 2)), array('alt' => 'BlogBundle:Post:error')) ?>
571 ```
3341c8e @fabpot [FrameworkBundle] restricted to only URIs the first argument of the a…
fabpot authored
572
4d40b11 @benja-M-1 Add notes about kernel.trusted_proxies parameter
benja-M-1 authored
573 #### Configuration
574
b7e4cff @fabpot tweaked previous merge
fabpot authored
575 * The 2.2 version introduces a new parameter `trusted_proxies` that replaces
576 `trust_proxy_headers` in the framework configuration.
4d40b11 @benja-M-1 Add notes about kernel.trusted_proxies parameter
benja-M-1 authored
577
578 Before:
579
580 ```
581 # app/config/config.yml
582 framework:
583 trust_proxy_headers: false
584 ```
585
586 After:
587
588 ```
589 # app/config/config.yml
590 framework:
b7e4cff @fabpot tweaked previous merge
fabpot authored
591 trusted_proxies: ['127.0.0.1', '10.0.0.1'] # a list of proxy IPs you trust
4d40b11 @benja-M-1 Add notes about kernel.trusted_proxies parameter
benja-M-1 authored
592 ```
b6bdb45 @beberlei Completly refactor the Serializer Options Pull Request to push contex…
beberlei authored
593
35b62ac @hhamon [Security] renamed Constraint namespace to Constraints for validator …
hhamon authored
594 ### Security
595
596 * The existing ``UserPassword`` validator constraint class has been modified.
597 Its namespace has been changed to better fit the Symfony coding conventions.
598
599 Before:
600
601 ```
602 use Symfony\Component\Security\Core\Validator\Constraint\UserPassword;
603 ```
604
605 After: (note the `s` at the end of `Constraint`)
606
607 ```
608 use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
609 ```
610
611 * The new ``UserPassword`` validator constraint class now accepts a new
612 ``service`` option that allows to specify a custom validator service name in
613 order to validate the current logged-in user's password.
614
615 ```
616 use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
617
618 $constraint = new UserPassword(array(
619 'service' => 'my.custom.validator.user_password',
620 ));
621 ```
622
623 #### Deprecations
624
625 * The two previous ``UserPassword`` and ``UserPasswordValidator`` classes in
626 the ``Symfony\Component\Security\Core\Validator\Constraint`` namespace have
627 been deprecated and will be removed in 2.3.
628
629 Before:
630
631 ```
632 use Symfony\Component\Security\Core\Validator\Constraint\UserPassword;
633 use Symfony\Component\Security\Core\Validator\Constraint\UserPasswordValidator;
634 ```
635
636 After:
637
638 ```
639 use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
640 use Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator;
641 ```
642
6923a48 @fabpot fixed markup
fabpot authored
643 ### Serializer
b6bdb45 @beberlei Completly refactor the Serializer Options Pull Request to push contex…
beberlei authored
644
6923a48 @fabpot fixed markup
fabpot authored
645 * All serializer interfaces (Serializer, Normalizer, Encoder) have been
646 extended with an optional `$context` array. This was necessary to allow for
647 more complex use-cases that require context information during the
648 (de)normalization and en-/decoding steps.
Something went wrong with that request. Please try again.