summaryrefslogtreecommitdiff
path: root/UPGRADE-3.0.md
blob: 08796bd419d2981be453300a7939c89425456608 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
UPGRADE FROM 2.x to 3.0
=======================

### ClassLoader

 * The `UniversalClassLoader` class has been removed in favor of
   `ClassLoader`. The only difference is that some method names are different:

   | Old name | New name
   | -------- | ---
   | `registerNamespaces()` | `addPrefixes()`
   | `registerPrefixes()` | `addPrefixes()`
   | `registerNamespace()` | `addPrefix()`
   | `registerPrefix()` | `addPrefix()`
   | `getNamespaces()` | `getPrefixes()`
   | `getNamespaceFallbacks()` | `getFallbackDirs()`
   | `getPrefixFallbacks()` | `getFallbackDirs()`

 * The `DebugUniversalClassLoader` class has been removed in favor of
   `DebugClassLoader`. The difference is that the constructor now takes a
   loader to wrap.

### Config

 * `\Symfony\Component\Config\Resource\ResourceInterface::isFresh()` has been removed. Also,
   cache validation through this method (which was still supported in 2.8 for BC) does no longer
   work because the `\Symfony\Component\Config\Resource\BCResourceInterfaceChecker` helper class
   has been removed as well.

 * The `__toString()` method of the `\Symfony\Component\Config\ConfigCache` class
   was removed in favor of the new `getPath()` method.

### Console

 * The `dialog` helper has been removed in favor of the `question` helper.

 * The methods `isQuiet`, `isVerbose`, `isVeryVerbose` and `isDebug` were added
   to `Symfony\Component\Console\Output\OutputInterface`.

 * `ProgressHelper` has been removed in favor of `ProgressBar`.

   Before:

   ```php
   $h = new ProgressHelper();
   $h->start($output, 10);
   for ($i = 1; $i < 5; $i++) {
       usleep(200000);
       $h->advance();
   }
   $h->finish();
   ```

   After:

   ```php
   $bar = new ProgressBar($output, 10);
   $bar->start();
   for ($i = 1; $i < 5; $i++) {
       usleep(200000);
       $bar->advance();
   }
   ```

 * `TableHelper` has been removed in favor of `Table`.

   Before:

   ```php
   $table = $app->getHelperSet()->get('table');
   $table
       ->setHeaders(array('ISBN', 'Title', 'Author'))
       ->setRows(array(
           array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
           array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
           array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
           array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
       ))
   ;
   $table->render($output);
   ```

   After:

   ```php
   use Symfony\Component\Console\Helper\Table;

   $table = new Table($output);
   $table
       ->setHeaders(array('ISBN', 'Title', 'Author'))
       ->setRows(array(
           array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
           array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
           array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
           array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
       ))
   ;
   $table->render();
   ```

### DependencyInjection

 * The concept of scopes was removed, the removed methods are:

    - `Symfony\Component\DependencyInjection\ContainerBuilder::getScopes()`
    - `Symfony\Component\DependencyInjection\ContainerBuilder::getScopeChildren()`
    - `Symfony\Component\DependencyInjection\ContainerInterface::enterScope()`
    - `Symfony\Component\DependencyInjection\ContainerInterface::leaveScope()`
    - `Symfony\Component\DependencyInjection\ContainerInterface::addScope()`
    - `Symfony\Component\DependencyInjection\ContainerInterface::hasScope()`
    - `Symfony\Component\DependencyInjection\ContainerInterface::isScopeActive()`
    - `Symfony\Component\DependencyInjection\Definition::setScope()`
    - `Symfony\Component\DependencyInjection\Definition::getScope()`
    - `Symfony\Component\DependencyInjection\Reference::isStrict()`

  Also, the `$scope` and `$strict` parameters of `Symfony\Component\DependencyInjection\ContainerInterface::set()`
  and `Symfony\Component\DependencyInjection\Reference` respectively were removed.

 * A new `shared` flag has been added to the service definition
   in replacement of the `prototype` scope.

   Before:

   ```php
   use Symfony\Component\DependencyInjection\ContainerBuilder;

   $container = new ContainerBuilder();
   $container
       ->register('foo', 'stdClass')
       ->setScope(ContainerBuilder::SCOPE_PROTOTYPE)
   ;
   ```

   ```yml
   services:
       foo:
           class: stdClass
           scope: prototype
   ```

   ```xml
   <services>
       <service id="foo" class="stdClass" scope="prototype" />
   </services>
   ```

   After:

   ```php
   use Symfony\Component\DependencyInjection\ContainerBuilder;

   $container = new ContainerBuilder();
   $container
       ->register('foo', 'stdClass')
       ->setShared(false)
   ;
   ```

   ```yml
   services:
       foo:
           class: stdClass
           shared: false
   ```

   ```xml
   <services>
       <service id="foo" class="stdClass" shared="false" />
   </services>
   ```

 * `Symfony\Component\DependencyInjection\ContainerAware` was removed, use
   `Symfony\Component\DependencyInjection\ContainerAwareTrait` or implement
   `Symfony\Component\DependencyInjection\ContainerAwareInterface` manually

 * The methods `Definition::setFactoryClass()`,
   `Definition::setFactoryMethod()`, and `Definition::setFactoryService()` have
   been removed in favor of `Definition::setFactory()`. Services defined using
   YAML or XML use the same syntax as configurators.

 * Synchronized services are deprecated and the following methods have been
   removed: `ContainerBuilder::synchronize()`, `Definition::isSynchronized()`,
   and `Definition::setSynchronized()`.

### DoctrineBridge

 * The `property` option of `DoctrineType` was removed in favor of the `choice_label` option.

 * The `loader` option of `DoctrineType` was removed. You now have to override the `getLoader()`
   method in your custom type.

 * The `Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList` was removed in favor
   of `Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader`.

 * Passing a query builder closure to `ORMQueryBuilderLoader` is not supported anymore.
   You should pass resolved query builders only.

   Consequently, the arguments `$manager` and `$class` of `ORMQueryBuilderLoader`
   have been removed as well.

   Note that the `query_builder` option of `DoctrineType` *does* support
   closures, but the closure is now resolved in the type instead of in the
   loader.

### EventDispatcher

 * The interface `Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface`
   extends `Symfony\Component\EventDispatcher\EventDispatcherInterface`.

### Form

 * The option `options` of the `CollectionType` has been removed in favor
   of the `entry_options` option.

 * The `cascade_validation` option was removed. Use the `constraints` option
   together with the `Valid` constraint instead.

 * Type names were removed. Instead of referencing types by name, you must
   reference them by their fully-qualified class name (FQCN) instead:

   Before:

   ```php
   $form = $this->createFormBuilder()
       ->add('name', 'text')
       ->add('age', 'integer')
       ->getForm();
   ```

   After:

   ```php
   use Symfony\Component\Form\Extension\Core\Type\IntegerType;
   use Symfony\Component\Form\Extension\Core\Type\TextType;

   $form = $this->createFormBuilder()
       ->add('name', TextType::class)
       ->add('age', IntegerType::class)
       ->getForm();
   ```

   If you want to customize the block prefix of a type in Twig, you must now
   implement `FormTypeInterface::getBlockPrefix()`:

   Before:

   ```php
   class UserProfileType extends AbstractType
   {
       public function getName()
       {
           return 'profile';
       }
   }
   ```

   After:

   ```php
   class UserProfileType extends AbstractType
   {
       public function getBlockPrefix()
       {
           return 'profile';
       }
   }
   ```

   If you don't customize `getBlockPrefix()`, it defaults to the class name
   without "Type" suffix in underscore notation (here: "user_profile").

   Type extension must return the fully-qualified class name of the extended
   type from `FormTypeExtensionInterface::getExtendedType()` now.

   Before:

   ```php
   class MyTypeExtension extends AbstractTypeExtension
   {
       public function getExtendedType()
       {
           return 'form';
       }
   }
   ```

   After:

   ```php
   use Symfony\Component\Form\Extension\Core\Type\FormType;

   class MyTypeExtension extends AbstractTypeExtension
   {
       public function getExtendedType()
       {
           return FormType::class;
       }
   }
   ```

 * The `FormTypeInterface::getName()` method was removed.

 * Returning type instances from `FormTypeInterface::getParent()` is not
   supported anymore. Return the fully-qualified class name of the parent
   type class instead.

   Before:

   ```php
   class MyType
   {
       public function getParent()
       {
           return new ParentType();
       }
   }
   ```

   After:

   ```php
   class MyType
   {
       public function getParent()
       {
           return ParentType::class;
       }
   }
   ```

 * The option `type` of the `CollectionType` has been removed in favor of
   the `entry_type` option. The value for the `entry_type` option must be
   the fully-qualified class name (FQCN).

 * Passing type instances to `Form::add()`, `FormBuilder::add()` and the
   `FormFactory::create*()` methods is not supported anymore. Pass the
   fully-qualified class name of the type instead.

   Before:

   ```php
   $form = $this->createForm(new MyType());
   ```

   After:

   ```php
   $form = $this->createForm(MyType::class);
   ```

 * The alias option of the `form.type_extension` tag was removed in favor of
   the `extended_type`/`extended-type` option.

   Before:
   ```xml
   <service id="app.type_extension" class="Vendor\Form\Extension\MyTypeExtension">
       <tag name="form.type_extension" alias="text" />
   </service>
   ```

   After:
   ```xml
   <service id="app.type_extension" class="Vendor\Form\Extension\MyTypeExtension">
       <tag name="form.type_extension" extended-type="Symfony\Component\Form\Extension\Core\Type\TextType" />
   </service>
   ```

 * The `max_length` option was removed. Use the `attr` option instead by setting it to
   an `array` with a `maxlength` key.

 * The `ChoiceToBooleanArrayTransformer`, `ChoicesToBooleanArrayTransformer`,
   `FixRadioInputListener`, and `FixCheckboxInputListener` classes were removed.

 * The `choice_list` option of `ChoiceType` was removed.

 * The option "precision" was renamed to "scale".

   Before:

   ```php
   use Symfony\Component\Form\Extension\Core\Type\NumberType;

   $builder->add('length', NumberType::class, array(
      'precision' => 3,
   ));
   ```

   After:

   ```php
   use Symfony\Component\Form\Extension\Core\Type\NumberType;

   $builder->add('length', NumberType::class, array(
      'scale' => 3,
   ));
   ```

 * The option "`virtual`" was renamed to "`inherit_data`".

   Before:

   ```php
   use Symfony\Component\Form\Extension\Core\Type\FormType;

   $builder->add('address', FormType::class, array(
       'virtual' => true,
   ));
   ```

   After:

   ```php
   use Symfony\Component\Form\Extension\Core\Type\FormType;

   $builder->add('address', FormType::class, array(
       'inherit_data' => true,
   ));
   ```

 * The method `AbstractType::setDefaultOptions(OptionsResolverInterface $resolver)` and
   `AbstractTypeExtension::setDefaultOptions(OptionsResolverInterface $resolver)` have been
   renamed. You should use `AbstractType::configureOptions(OptionsResolver $resolver)` and
   `AbstractTypeExtension::configureOptions(OptionsResolver $resolver)` instead.

 * The methods `Form::bind()` and `Form::isBound()` were removed. You should
   use `Form::submit()` and `Form::isSubmitted()` instead.

   Before:

   ```php
   $form->bind(array(...));
   ```

   After:

   ```php
   $form->submit(array(...));
   ```

 * Passing a `Symfony\Component\HttpFoundation\Request` instance, as was
   supported by `FormInterface::bind()`, is not possible with
   `FormInterface::submit()` anymore. You should use `FormInterface::handleRequest()`
   instead.

   Before:

   ```php
   if ('POST' === $request->getMethod()) {
       $form->bind($request);

       if ($form->isValid()) {
           // ...
       }
   }
   ```

   After:

   ```php
   $form->handleRequest($request);

   if ($form->isValid()) {
       // ...
   }
   ```

   If you want to test whether the form was submitted separately, you can use
   the method `isSubmitted()`:

   ```php
   $form->handleRequest($request);

   if ($form->isSubmitted()) {
      // ...

      if ($form->isValid()) {
          // ...
      }
   }
   ```

 * The events `PRE_BIND`, `BIND` and `POST_BIND` were renamed to `PRE_SUBMIT`, `SUBMIT`
   and `POST_SUBMIT`.

   Before:

   ```php
   $builder->addEventListener(FormEvents::PRE_BIND, function (FormEvent $event) {
       // ...
   });
   ```

   After:

   ```php
   $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) {
       // ...
   });
   ```

 * The class `VirtualFormAwareIterator` was renamed to `InheritDataAwareIterator`.

   Before:

   ```php
   use Symfony\Component\Form\Util\VirtualFormAwareIterator;

   $iterator = new VirtualFormAwareIterator($forms);
   ```

   After:

   ```php
   use Symfony\Component\Form\Util\InheritDataAwareIterator;

   $iterator = new InheritDataAwareIterator($forms);
   ```

 * The `TypeTestCase` class was moved from the `Symfony\Component\Form\Tests\Extension\Core\Type` namespace to the `Symfony\Component\Form\Test` namespace.

   Before:

   ```php
   use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase

   class MyTypeTest extends TypeTestCase
   {
       // ...
   }
   ```

   After:

   ```php
   use Symfony\Component\Form\Test\TypeTestCase;

   class MyTypeTest extends TypeTestCase
   {
       // ...
   }
   ```

 * The option "options" of the CollectionType has been renamed to "entry_options".

 * The option "type" of the CollectionType has been renamed to "entry_type".
   As a value for the option you must provide the fully-qualified class name (FQCN)
   now as well.

 * The `FormIntegrationTestCase` and `FormPerformanceTestCase` classes were moved form the `Symfony\Component\Form\Tests` namespace to the `Symfony\Component\Form\Test` namespace.

 * The constants `ROUND_HALFEVEN`, `ROUND_HALFUP` and `ROUND_HALFDOWN` in class
   `NumberToLocalizedStringTransformer` were renamed to `ROUND_HALF_EVEN`,
   `ROUND_HALF_UP` and `ROUND_HALF_DOWN`.

 * The `Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface` was
   removed in favor of `Symfony\Component\Form\ChoiceList\ChoiceListInterface`.

 * `Symfony\Component\Form\Extension\Core\View\ChoiceView` was removed in favor of
   `Symfony\Component\Form\ChoiceList\View\ChoiceView`.

 * The interface `Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface`
   and all of its implementations were removed. Use the new interface
   `Symfony\Component\Security\Csrf\CsrfTokenManagerInterface` instead.

 * The options "`csrf_provider`" and "`intention`" were renamed to  "`csrf_token_generator`"
   and "`csrf_token_id`".

 * The method `Form::getErrorsAsString()` was removed. Use `Form::getErrors()`
   instead with the argument `$deep` set to true and `$flatten` set to false
   and cast the returned iterator to a string (if not done implicitly by PHP).

   Before:

   ```php
   echo $form->getErrorsAsString();
   ```

   After:

   ```php
   echo $form->getErrors(true, false);
   ```

 * The `Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList` class has been removed in
   favor of `Symfony\Component\Form\ChoiceList\ArrayChoiceList`.

 * The `Symfony\Component\Form\Extension\Core\ChoiceList\LazyChoiceList` class has been removed in
   favor of `Symfony\Component\Form\ChoiceList\LazyChoiceList`.

 * The `Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList` class has been removed in
   favor of `Symfony\Component\Form\ChoiceList\ArrayChoiceList`.

 * The `Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList` class has been removed in
   favor of `Symfony\Component\Form\ChoiceList\ArrayChoiceList`.

 * The `TimezoneType::getTimezones()` method was removed. You should not use
   this method.

 * The `Symfony\Component\Form\ChoiceList\ArrayKeyChoiceList` class has been removed in
   favor of `Symfony\Component\Form\ChoiceList\ArrayChoiceList`.

### FrameworkBundle

 * The `config:debug`, `container:debug`, `router:debug`, `translation:debug`
   and `yaml:lint` commands have been deprecated since Symfony 2.7 and will
   be removed in Symfony 3.0. Use the `debug:config`, `debug:container`,
   `debug:router`, `debug:translation` and `lint:yaml` commands instead.

 * The `getRequest` method of the base `Controller` class has been deprecated
   since Symfony 2.4 and must be therefore removed in 3.0. The only reliable
   way to get the `Request` object is to inject it in the action method.

   Before:

   ```php
   namespace Acme\FooBundle\Controller;

   class DemoController
   {
       public function showAction()
       {
           $request = $this->getRequest();
           // ...
       }
   }
   ```

   After:

   ```php
   namespace Acme\FooBundle\Controller;

   use Symfony\Component\HttpFoundation\Request;

   class DemoController
   {
       public function showAction(Request $request)
       {
           // ...
       }
   }
   ```

 * In Symfony 2.7 a small BC break was introduced with the new choices_as_values
   option. In order to have the choice values populated to the html value attribute
   you had to define the choice_value option. This is now not any more needed.

   Before:

   ```php
   $form->add('status', 'choice', array(
       'choices' => array(
           'Enabled' => Status::ENABLED,
           'Disabled' => Status::DISABLED,
           'Ignored' => Status::IGNORED,
       ),
       // choices_as_values defaults to true in Symfony 3.0
       // and setting it to anything else is deprecated as of 3.0
       'choices_as_values' => true,
       // important if you rely on your option value attribute (e.g. for JavaScript)
       // this will keep the same functionality as before
       'choice_value' => function ($choice) {
           return $choice;
       },
   ));
   ```

   After:

   ```php
   $form->add('status', ChoiceType::class, array(
       'choices' => array(
           'Enabled' => Status::ENABLED,
           'Disabled' => Status::DISABLED,
           'Ignored' => Status::IGNORED,
       )
   ));
   ```

 * The `request` service was removed. You must inject the `request_stack`
   service instead.

 * The `enctype` method of the `form` helper was removed. You should use the
   new method `start` instead.

   Before:

   ```php
   <form method="post" action="http://example.com" <?php echo $view['form']->enctype($form) ?>>
       ...
   </form>
   ```

   After:

   ```php
   <?php echo $view['form']->start($form) ?>
       ...
   <?php echo $view['form']->end($form) ?>
   ```

   The method and action of the form default to "POST" and the current
   document. If you want to change these values, you can set them explicitly in
   the controller.

   Alternative 1:

   ```php
   $form = $this->createForm('my_form', $formData, array(
       'method' => 'PUT',
       'action' => $this->generateUrl('target_route'),
   ));
   ```

   Alternative 2:

   ```php
   $form = $this->createFormBuilder($formData)
       // ...
       ->setMethod('PUT')
       ->setAction($this->generateUrl('target_route'))
       ->getForm();
   ```

   It is also possible to override the method and the action in the template:

   ```php
   <?php echo $view['form']->start($form, array('method' => 'GET', 'action' => 'http://example.com')) ?>
       ...
   <?php echo $view['form']->end($form) ?>
   ```

 * The `RouterApacheDumperCommand` was removed.

 * The `templating.helper.router` service was moved to `templating_php.xml`. You
   have to ensure that the PHP templating engine is enabled to be able to use it:

   ```yaml
   framework:
       templating:
           engines: ['php']
   ```

 * The `form.csrf_provider` service is removed as it implements an adapter for
   the new token manager to the deprecated
   `Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface`
   interface.
   The `security.csrf.token_manager` should be used instead.

 * The `validator.mapping.cache.apc` service has been removed in favor of the `validator.mapping.cache.doctrine.apc` one.

 * The ability to pass `apc` as the `framework.validation.cache` configuration key value has been removed.
   Use `validator.mapping.cache.doctrine.apc` instead:

   Before:

   ```yaml
   framework:
       validation:
           cache: apc
   ```

   After:

   ```yaml
   framework:
       validation:
           cache: validator.mapping.cache.doctrine.apc
   ```

### HttpKernel

 * The `Symfony\Component\HttpKernel\Log\LoggerInterface` has been removed in
   favor of `Psr\Log\LoggerInterface`. The only difference is that some method
   names are different:

   | Old name | New name
   | -------- | ---
   | `emerg()` | `emergency()`
   | `crit()` | `critical()`
   | `err()` | `error()`
   | `warn()` | `warning()`

   The previous method renames also happened to the following classes:

     * `Symfony\Bridge\Monolog\Logger`
     * `Symfony\Component\HttpKernel\Log\NullLogger`

 * The `Symfony\Component\HttpKernel\Kernel::init()` method has been removed.

 * The following classes have been renamed as they have been moved to the
   Debug component:

   | Old name | New name
   | -------- | ---
   | `Symfony\Component\HttpKernel\Debug\ErrorHandler` | `Symfony\Component\Debug\ErrorHandler`
   | `Symfony\Component\HttpKernel\Debug\ExceptionHandler` | `Symfony\Component\Debug\ExceptionHandler`
   | `Symfony\Component\HttpKernel\Exception\FatalErrorException` | `Symfony\Component\Debug\Exception\FatalErrorException`
   | `Symfony\Component\HttpKernel\Exception\FlattenException` | `Symfony\Component\Debug\Exception\FlattenException`

 * The `Symfony\Component\HttpKernel\EventListener\ExceptionListener` now
   passes the Request format as the `_format` argument instead of `format`.

 * The `Symfony\Component\HttpKernel\DependencyInjection\RegisterListenersPass` has been renamed to
   `Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass` and moved to the EventDispatcher component.

### Locale

 * The Locale component was removed and replaced by the Intl component.
   Instead of the methods in `Symfony\Component\Locale\Locale`, you should use
   these equivalent methods in `Symfony\Component\Intl\Intl` now:

   | Old way | New way
   | ------- | ---
   | `Locale::getDisplayCountries()` | `Intl::getRegionBundle()->getCountryNames()`
   | `Locale::getCountries()` | `array_keys(Intl::getRegionBundle()->getCountryNames())`
   | `Locale::getDisplayLanguages()` | `Intl::getLanguageBundle()->getLanguageNames()`
   | `Locale::getLanguages()` | `array_keys(Intl::getLanguageBundle()->getLanguageNames())`
   | `Locale::getDisplayLocales()` | `Intl::getLocaleBundle()->getLocaleNames()`
   | `Locale::getLocales()` | `array_keys(Intl::getLocaleBundle()->getLocaleNames())`

### PropertyAccess

 * Renamed `PropertyAccess::getPropertyAccessor` to `createPropertyAccessor`.

   Before:

   ```php
   use Symfony\Component\PropertyAccess\PropertyAccess;

   $accessor = PropertyAccess::getPropertyAccessor();
   ```

   After:

   ```php
   use Symfony\Component\PropertyAccess\PropertyAccess;

   $accessor = PropertyAccess::createPropertyAccessor();
   ```

### Routing

 * Some route settings have been renamed:

     * The `pattern` setting has been removed in favor of `path`
     * The `_scheme` and `_method` requirements have been moved to the `schemes` and `methods` settings

   Before:

   ```yaml
   article_edit:
       pattern: /article/{id}
       requirements: { '_method': 'POST|PUT', '_scheme': 'https', 'id': '\d+' }
   ```

   ```xml
   <route id="article_edit" pattern="/article/{id}">
       <requirement key="_method">POST|PUT</requirement>
       <requirement key="_scheme">https</requirement>
       <requirement key="id">\d+</requirement>
   </route>
   ```

   ```php
   $route = new Route();
   $route->setPattern('/article/{id}');
   $route->setRequirement('_method', 'POST|PUT');
   $route->setRequirement('_scheme', 'https');
   ```

   After:

   ```yaml
   article_edit:
       path: /article/{id}
       methods: [POST, PUT]
       schemes: https
       requirements: { 'id': '\d+' }
   ```

   ```xml
   <route id="article_edit" path="/article/{id}" methods="POST PUT" schemes="https">
       <requirement key="id">\d+</requirement>
   </route>
   ```

   ```php
   $route = new Route();
   $route->setPath('/article/{id}');
   $route->setMethods(array('POST', 'PUT'));
   $route->setSchemes('https');
   ```

 * The `ApacheMatcherDumper` and `ApacheUrlMatcher` were removed since
   the performance gains were minimal and it's hard to replicate the behaviour
   of PHP implementation.

 * The `getMatcherDumperInstance()` and `getGeneratorDumperInstance()` methods in the
   `Symfony\Component\Routing\Router` have been changed from `public` to `protected`.

### Security

 * The `Resources/` directory was moved to `Core/Resources/`

 * The `key` settings of `anonymous`, `remember_me` and `http_digest` are
   renamed to `secret`.

   Before:

   ```yaml
   security:
       # ...
       firewalls:
           default:
               # ...
               anonymous: { key: "%secret%" }
               remember_me:
                   key: "%secret%"
               http_digest:
                   key: "%secret%"
   ```

   ```xml
   <!-- ... -->
   <config>
       <!-- ... -->

       <firewall>
           <!-- ... -->

           <anonymous key="%secret%"/>
           <remember-me key="%secret%"/>
           <http-digest key="%secret%"/>
       </firewall>
   </config>
   ```

   ```php
   // ...
   $container->loadFromExtension('security', array(
       // ...
       'firewalls' => array(
           // ...
           'anonymous' => array('key' => '%secret%'),
           'remember_me' => array('key' => '%secret%'),
           'http_digest' => array('key' => '%secret%'),
       ),
   ));
   ```

   After:

   ```yaml
   security:
       # ...
       firewalls:
           default:
               # ...
               anonymous: { secret: "%secret%" }
               remember_me:
                   secret: "%secret%"
               http_digest:
                   secret: "%secret%"
   ```

   ```xml
   <!-- ... -->
   <config>
       <!-- ... -->

       <firewall>
           <!-- ... -->

           <anonymous secret="%secret%"/>
           <remember-me secret="%secret%"/>
           <http-digest secret="%secret%"/>
       </firewall>
   </config>
   ```

   ```php
   // ...
   $container->loadFromExtension('security', array(
       // ...
       'firewalls' => array(
           // ...
           'anonymous' => array('secret' => '%secret%'),
           'remember_me' => array('secret' => '%secret%'),
           'http_digest' => array('secret' => '%secret%'),
       ),
   ));
  ```

 * The `AbstractVoter` class was removed. Instead, extend the new `Voter` class,
   introduced in 2.8, and move your voting logic to the to the `supports($attribute, $subject)`
   and `voteOnAttribute($attribute, $object, TokenInterface $token)` methods.

 * The `vote()` method from the `VoterInterface` was changed to now accept arbitrary
   types, and not only objects.

 * The `supportsClass` and `supportsAttribute` methods were
   removed from the `VoterInterface` interface.

   Before:

   ```php
   class MyVoter extends AbstractVoter
   {
       protected function getSupportedAttributes()
       {
           return array('CREATE', 'EDIT');
       }

       protected function getSupportedClasses()
       {
           return array('AppBundle\Entity\Post');
       }

       // ...
   }
   ```

   After:

   ```php
   use Symfony\Component\Security\Core\Authorization\Voter\Voter;

   class MyVoter extends Voter
   {
       protected function supports($attribute, $object)
       {
           return $object instanceof Post && in_array($attribute, array('CREATE', 'EDIT'));
       }

       protected function voteOnAttribute($attribute, $object, TokenInterface $token)
       {
           // Return true or false
       }
   }
   ```

 * The `AbstractVoter::isGranted()` method has been replaced by `Voter::voteOnAttribute()`.

   Before:

   ```php
   class MyVoter extends AbstractVoter
   {
       protected function isGranted($attribute, $object, $user = null)
       {
           return 'EDIT' === $attribute && $user === $object->getAuthor();
       }

       // ...
   }
   ```

   After:

   ```php
   class MyVoter extends Voter
   {
       protected function voteOnAttribute($attribute, $object, TokenInterface $token)
       {
           return 'EDIT' === $attribute && $token->getUser() === $object->getAuthor();
       }

       // ...
   }
   ```

 * The `supportsAttribute()` and `supportsClass()` methods of the `AuthenticatedVoter`, `ExpressionVoter`,
   and `RoleVoter` classes have been removed.

 * The `intention` option was renamed to `csrf_token_id` for all the authentication listeners.

 * The `csrf_provider` option was renamed to `csrf_token_generator` for all the authentication listeners.

### SecurityBundle

 * The `intention` firewall listener setting was renamed to `csrf_token_id`.

 * The `csrf_provider` firewall listener setting was renamed to `csrf_token_generator`.

### Serializer

 * The `setCamelizedAttributes()` method of the
   `Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer` and
   `Symfony\Component\Serializer\Normalizer\PropertyNormalizer` classes
   was removed.

 * The `Symfony\Component\Serializer\Exception\Exception` interface was removed
   in favor of the new `Symfony\Component\Serializer\Exception\ExceptionInterface`.

### Translator

 * The `Translator::setFallbackLocale()` method has been removed in favor of
   `Translator::setFallbackLocales()`.

 * The `getMessages()` method of the `Symfony\Component\Translation\Translator`
   class was removed. You should use the `getCatalogue()` method of the
   `Symfony\Component\Translation\TranslatorBagInterface`.

### Twig Bridge

 * The `twig:lint` command has been deprecated since Symfony 2.7 and will be
   removed in Symfony 3.0. Use the `lint:twig` command instead.

 * The `render` tag is deprecated in favor of the `render` function.

 * The `form_enctype` helper was removed. You should use the new `form_start`
   function instead.

   Before:

   ```php
   <form method="post" action="http://example.com" {{ form_enctype(form) }}>
       ...
   </form>
   ```

   After:

   ```jinja
   {{ form_start(form) }}
       ...
   {{ form_end(form) }}
   ```

   The method and action of the form default to "POST" and the current
   document. If you want to change these values, you can set them explicitly in
   the controller.

   Alternative 1:

   ```php
   $form = $this->createForm('my_form', $formData, array(
       'method' => 'PUT',
       'action' => $this->generateUrl('target_route'),
   ));
   ```

   Alternative 2:

   ```php
   $form = $this->createFormBuilder($formData)
       // ...
       ->setMethod('PUT')
       ->setAction($this->generateUrl('target_route'))
       ->getForm();
   ```

   It is also possible to override the method and the action in the template:

   ```jinja
   {{ form_start(form, {'method': 'GET', 'action': 'http://example.com'}) }}
       ...
   {{ form_end(form) }}
   ```

### TwigBundle

 * The `Symfony\Bundle\TwigBundle\TwigDefaultEscapingStrategy` was removed
   in favor of `Twig_FileExtensionEscapingStrategy`.

 * The `twig:debug` command has been deprecated since Symfony 2.7 and will be
   removed in Symfony 3.0. Use the `debug:twig` command instead.

### Validator

 * The PHP7-incompatible constraints (`Null`, `True`, `False`) and their related
   validators (`NullValidator`, `TrueValidator`, `FalseValidator`) have been
   removed in favor of their `Is`-prefixed equivalent.

 * The class `Symfony\Component\Validator\Mapping\Cache\ApcCache` has been removed in favor
   of `Symfony\Component\Validator\Mapping\Cache\DoctrineCache`.

   Before:

   ```php
   use Symfony\Component\Validator\Mapping\Cache\ApcCache;

   $cache = new ApcCache('symfony.validator');
   ```

   After:

   ```php
   use Symfony\Component\Validator\Mapping\Cache\DoctrineCache;
   use Doctrine\Common\Cache\ApcCache;

   $apcCache = new ApcCache();
   $apcCache->setNamespace('symfony.validator');

   $cache = new DoctrineCache($apcCache);
   ```

 * The constraints `Optional` and `Required` were moved to the
   `Symfony\Component\Validator\Constraints\` namespace. You should adapt
   the path wherever you used them.

   Before:

   ```php
   use Symfony\Component\Validator\Constraints as Assert;

   /**
    * @Assert\Collection({
    *     "foo" = @Assert\Collection\Required(),
    *     "bar" = @Assert\Collection\Optional(),
    * })
    */
   private $property;
   ```

   After:

   ```php
   use Symfony\Component\Validator\Constraints as Assert;

   /**
    * @Assert\Collection({
    *     "foo" = @Assert\Required(),
    *     "bar" = @Assert\Optional(),
    * })
    */
   private $property;
   ```

 * The option "`methods`" of the `Callback` constraint was removed. You should
   use the option "`callback`" instead. If you have multiple callbacks, add
   multiple callback constraints instead.

   Before (YAML):

   ```yaml
   constraints:
     - Callback: [firstCallback, secondCallback]
   ```

   After (YAML):

   ```yaml
   constraints:
     - Callback: firstCallback
     - Callback: secondCallback
   ```

   When using annotations, you can now put the `Callback` constraint directly on
   the method that should be executed.

   Before (Annotations):

   ```php
   use Symfony\Component\Validator\Constraints as Assert;
   use Symfony\Component\Validator\ExecutionContextInterface;

   /**
    * @Assert\Callback({"callback"})
    */
   class MyClass
   {
       public function callback(ExecutionContextInterface $context)
       {
           // ...
       }
   }
   ```

   After (Annotations):

   ```php
   use Symfony\Component\Validator\Constraints as Assert;
   use Symfony\Component\Validator\ExecutionContextInterface;

   class MyClass
   {
       /**
        * @Assert\Callback
        */
       public function callback(ExecutionContextInterface $context)
       {
           // ...
       }
   }
   ```

 * The interface `ValidatorInterface` was replaced by the more powerful
   interface `Validator\ValidatorInterface`. The signature of the `validate()`
   method is slightly different in that interface and accepts a value, zero
   or more constraints and validation group. It replaces both
   `validate()` and `validateValue()` in the previous interface.

   Before:

   ```php
   $validator->validate($object, 'Strict');

   $validator->validateValue($value, new NotNull());
   ```

   After:

   ```php
   $validator->validate($object, null, 'Strict');

   $validator->validate($value, new NotNull());
   ```

   Apart from this change, the new methods `startContext()` and `inContext()`
   were added. The first of them allows to run multiple validations in the
   same context and aggregate their violations:

   ```php
   $violations = $validator->startContext()
       ->atPath('firstName')->validate($firstName, new NotNull())
       ->atPath('age')->validate($age, new Type('integer'))
       ->getViolations();
   ```

   The second allows to run validation in an existing context. This is
   especially useful when calling the validator from within constraint
   validators:

   ```php
   $validator->inContext($context)->validate($object);
   ```

   Instead of a `Validator`, the validator builder now returns a
   `Validator\RecursiveValidator` instead.

 * The interface `ValidationVisitorInterface` and its implementation
   `ValidationVisitor` were removed. The implementation of the visitor pattern
   was flawed. Fixing that implementation would have drastically slowed down
   the validator execution, so the visitor was removed completely instead.

   Along with the visitor, the method `accept()` was removed from
   `MetadataInterface`.

 * The interface `MetadataInterface` was moved to the `Mapping` namespace.

   Before:

   ```php
   use Symfony\Component\Validator\MetadataInterface;
   ```

   After:

   ```php
   use Symfony\Component\Validator\Mapping\MetadataInterface;
   ```

   The methods `getCascadingStrategy()` and `getTraversalStrategy()` were
   added to the interface. The first method should return a bit mask of the
   constants in class `CascadingStrategy`. The second should return a bit
   mask of the constants in `TraversalStrategy`.

   Example:

   ```php
   use Symfony\Component\Validator\Mapping\TraversalStrategy;

   public function getTraversalStrategy()
   {
       return TraversalStrategy::TRAVERSE;
   }
   ```

 * The interface `PropertyMetadataInterface` was moved to the `Mapping`
   namespace.

   Before:

   ```php
   use Symfony\Component\Validator\PropertyMetadataInterface;
   ```

   After:

   ```php
   use Symfony\Component\Validator\Mapping\PropertyMetadataInterface;
   ```

 * The interface `PropertyMetadataContainerInterface` was moved to the `Mapping`
   namespace and renamed to `ClassMetadataInterface`.

   Before:

   ```php
   use Symfony\Component\Validator\PropertyMetadataContainerInterface;
   ```

   After:

   ```php
   use Symfony\Component\Validator\Mapping\ClassMetadataInterface;
   ```

   The interface now contains four additional methods:

    * `getConstrainedProperties()`
    * `hasGroupSequence()`
    * `getGroupSequence()`
    * `isGroupSequenceProvider()`

   See the inline documentation of these methods for more information.

 * The interface `ClassBasedInterface` was removed. You should use
   `Mapping\ClassMetadataInterface` instead:

   Before:

   ```php
   use Symfony\Component\Validator\ClassBasedInterface;

   class MyClassMetadata implements ClassBasedInterface
   {
       // ...
   }
   ```

   After:

   ```php
   use Symfony\Component\Validator\Mapping\ClassMetadataInterface;

   class MyClassMetadata implements ClassMetadataInterface
   {
       // ...
   }
   ```

 * The class `ElementMetadata` was renamed to `GenericMetadata`.

   Before:

   ```php
   use Symfony\Component\Validator\Mapping\ElementMetadata;

   class MyMetadata extends ElementMetadata
   {
   }
   ```

   After:

   ```php
   use Symfony\Component\Validator\Mapping\GenericMetadata;

   class MyMetadata extends GenericMetadata
   {
   }
   ```

 * The interface `ExecutionContextInterface` and its implementation
   `ExecutionContext` were moved to the `Context` namespace.

   Before:

   ```php
   use Symfony\Component\Validator\ExecutionContextInterface;
   ```

   After:

   ```php
   use Symfony\Component\Validator\Context\ExecutionContextInterface;
   ```

   The interface now contains the following additional methods:

    * `getValidator()`
    * `getObject()`
    * `setNode()`
    * `setGroup()`
    * `markGroupAsValidated()`
    * `isGroupValidated()`
    * `markConstraintAsValidated()`
    * `isConstraintValidated()`

   See the inline documentation of these methods for more information.

   The method `addViolationAt()` was removed. You should use `buildViolation()`
   instead.

   Before:

   ```php
   $context->addViolationAt('property', 'The value {{ value }} is invalid.', array(
       '{{ value }}' => $invalidValue,
   ));
   ```

   After:

   ```php
   $context->buildViolation('The value {{ value }} is invalid.')
       ->atPath('property')
       ->setParameter('{{ value }}', $invalidValue)
       ->addViolation();
   ```

   The methods `validate()` and `validateValue()` were removed. You should use
   `getValidator()` together with `inContext()` instead.

   Before:

   ```php
   $context->validate($object);
   ```

   After:

   ```php
   $context->getValidator()
       ->inContext($context)
       ->validate($object);
   ```

   The parameters `$invalidValue`, `$plural` and `$code` were removed from
   `addViolation()`. You should use `buildViolation()` instead. See above for
   an example.

   The method `getMetadataFactory()` was removed. You can use `getValidator()`
   instead and use the methods `getMetadataFor()` or `hasMetadataFor()` on the
   validator instance.

   Before:

   ```php
   $metadata = $context->getMetadataFactory()->getMetadataFor($myClass);
   ```

   After:

   ```php
   $metadata = $context->getValidator()->getMetadataFor($myClass);
   ```

 * The interface `GlobalExecutionContextInterface` was removed. Most of the
   information provided by that interface can be queried from
   `Context\ExecutionContextInterface` instead.

 * The interface `MetadataFactoryInterface` was moved to the `Mapping\Factory`
   namespace along with its implementations `BlackholeMetadataFactory` and
   `ClassMetadataFactory`. These classes were furthermore renamed to
   `BlackHoleMetadataFactory` and `LazyLoadingMetadataFactory`.

   Before:

   ```php
   use Symfony\Component\Validator\Mapping\ClassMetadataFactory;

   $factory = new ClassMetadataFactory($loader);
   ```

   After:

   ```php
   use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory;

   $factory = new LazyLoadingMetadataFactory($loader);
   ```

 * The option `$deep` was removed from the constraint `Valid`. When traversing
   arrays, nested arrays are always traversed (same behavior as before). When
   traversing nested objects, their traversal strategy is used.

 * The method `ValidatorBuilder::setPropertyAccessor()` was removed. The
   validator now functions without a property accessor.

 * The methods `getMessageParameters()` and `getMessagePluralization()` in
   `ConstraintViolation` were renamed to `getParameters()` and `getPlural()`.

   Before:

   ```php
   $parameters = $violation->getMessageParameters();
   $plural = $violation->getMessagePluralization();
   ```

   After:

   ```php
   $parameters = $violation->getParameters();
   $plural = $violation->getPlural();
   ```

 * The class `Symfony\Component\Validator\DefaultTranslator` was removed. You
   should use `Symfony\Component\Translation\IdentityTranslator` instead.

   Before:

   ```php
   $translator = new \Symfony\Component\Validator\DefaultTranslator();
   ```

   After:

   ```php
   $translator = new \Symfony\Component\Translation\IdentityTranslator();
   $translator->setLocale('en');
   ```

### Yaml

 * Using a colon in an unquoted mapping value leads to a `ParseException`.
 * Starting an unquoted string with `@`, `` ` ``, `|`, or `>` leads to a `ParseException`.
 * When surrounding strings with double-quotes, you must now escape `\` characters. Not
   escaping those characters (when surrounded by double-quotes) leads to a `ParseException`.

   Before:

   ```yml
   class: "Foo\Var"
   ```

   After:

   ```yml
   class: "Foo\\Var"
   ```


 * The ability to pass file names to `Yaml::parse()` has been removed.

   Before:

   ```php
   Yaml::parse($fileName);
   ```

   After:

   ```php
   Yaml::parse(file_get_contents($fileName));
   ```

### WebProfiler

 * The `profiler:import` and `profiler:export` commands have been removed.

 * All the profiler storages different than `FileProfilerStorage` have been
   removed. The removed classes are:

    - `Symfony\Component\HttpKernel\Profiler\BaseMemcacheProfilerStorage`
    - `Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage`
    - `Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage`
    - `Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage`
    - `Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage`
    - `Symfony\Component\HttpKernel\Profiler\PdoProfilerStorage`
    - `Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage`
    - `Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage`

### Process

 * `Process::setStdin()` and `Process::getStdin()` have been removed. Use
   `Process::setInput()` and `Process::getInput()` that works the same way.
 * `Process::setInput()` and `ProcessBuilder::setInput()` do not accept non-scalar types.

### HttpFoundation

 * Removed the feature that allowed finding deep items in `ParameterBag::get()`.
   This may affect you when getting parameters from the `Request` class:

   Before:

   ```php
   $request->query->get('foo[bar]', null, true);
   ```

   After:

   ```php
   $request->query->get('foo')[bar];
   ```