Skip to content

Commit c2ab644

Browse files
committed
Merge branch '2.0'
2 parents 13b54ac + 1839894 commit c2ab644

File tree

1 file changed

+57
-31
lines changed

1 file changed

+57
-31
lines changed

UPGRADING-2.0.md

Lines changed: 57 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,56 @@
11
Upgrading From 1.x To 2.0
22
=========================
33

4-
* The `RedirectView` and `RouteRedirect` view classes were removed. Use `View::createRedirect()`
5-
and `View::createRouteRedirect()` instead.
4+
* The `RedirectView` and `RouteRedirect` view classes were removed. Use
5+
`View::createRedirect()` and `View::createRouteRedirect()` instead.
66

7-
**Note**: the default status code for a route redirect has changed from HTTP_CREATED (201) to
8-
HTTP_FOUND (302).
7+
**Note**: the default status code for a route redirect has changed from
8+
HTTP_CREATED (201) to HTTP_FOUND (302).
99

10-
* The `FOS\RestBundle\Util\ViolationFormatter` class and the `FOS\RestBundle\Util\ViolationFormatterInterface`
11-
were removed. Catch specialized exception classes instead of checking specific exception messages.
10+
* The `FOS\RestBundle\Util\ViolationFormatter` class and the
11+
`FOS\RestBundle\Util\ViolationFormatterInterface` were removed.
12+
Catch specialized exception classes instead of checking specific
13+
exception messages.
1214

13-
* The `ViolationFormatterInterface` argument of the constructor of the `ParamFetcher` class was
14-
removed.
15+
* The `ViolationFormatterInterface` argument of the constructor of
16+
the `ParamFetcher` class was removed.
1517

16-
* The SensioFrameworkExtraBundle view annotations must be enabled to use the `ViewResponseListener`:
18+
* The SensioFrameworkExtraBundle view annotations must be enabled to
19+
use the `ViewResponseListener`:
1720

18-
```yaml
21+
```yml
1922
# app/config/config.yml
2023
sensio_framework_extra:
2124
view:
2225
annotations: true
2326
```
2427
25-
* dropped support for the legacy ``Symfony\Component\Validator\ValidatorInterface``
28+
* dropped support for the legacy
29+
`Symfony\Component\Validator\ValidatorInterface`
2630

27-
* removed ``FOS\RestBundle\Util\Codes`` in favor of ``Symfony\Component\HttpFoundation\Response`` constants
31+
* removed `FOS\RestBundle\Util\Codes` in favor of
32+
`Symfony\Component\HttpFoundation\Response` constants
2833

29-
* compatibility with Symfony <2.7, JMS Serializer/SerializerBundle <1.0 and SensioFrameworkExtraBundle <3.0 was dropped
34+
* compatibility with Symfony <2.7, JMS Serializer/SerializerBundle <1.0
35+
and SensioFrameworkExtraBundle <3.0 was dropped
3036

3137
* constructor signature of DisableCSRFExtension was changed
3238

33-
* constructor signatures of most of the classes which used the container were changed
39+
* constructor signatures of most of the classes which used the container
40+
were changed
41+
42+
* removed `callback_filter` configuration option for the `jsonp_handler`
43+
44+
* removed `fos_rest.format_listener.media_type` configuration option.
45+
Use the versioning section instead:
46+
47+
```yml
48+
# config.yml
3449
35-
* removed ``callback_filter`` configuration option for the jsonp_handler
50+
versioning: true
51+
```
3652

37-
* the ``exception_wrapper_handler`` config option was removed. Use normalizers instead.
53+
* the `exception_wrapper_handler` config option was removed. Use normalizers instead.
3854

3955
Before:
4056
```yml
@@ -85,9 +101,10 @@ Upgrading From 1.x To 2.0
85101
}
86102
```
87103

88-
* removed all ``.class`` parameters, instead overwriting services via explicit Bundle configuration is preferred
104+
* removed all `.class` parameters, instead overwriting services via
105+
explicit Bundle configuration is preferred
89106

90-
* renamed ``AbstractScalarParam::$array`` to ``AbstractScalarParam::$map``
107+
* renamed `AbstractScalarParam::$array` to `AbstractScalarParam::$map`
91108

92109
Before:
93110
```php
@@ -123,16 +140,20 @@ Upgrading From 1.x To 2.0
123140

124141
* added `ControllerTrait` for developers that prefer to use DI for their controllers instead of extending ``FOSRestController``
125142

126-
* when having an action called ``lockUserAction``, then it will have to use the http method ``LOCK`` (RFC-2518) instead of ``PATCH``. The following methods are affected by this change
127-
* ``COPY``
128-
* ``LOCK``
129-
* ``MKCOL``
130-
* ``MOVE``
131-
* ``PROPFIND``
132-
* ``PROPPATCH``
133-
* ``UNLOCK``
143+
* when having an action called ``lockUserAction``, then it will have to
144+
use the http method ``LOCK`` (RFC-2518) instead of ``PATCH``.
145+
The following methods are affected by this change:
146+
147+
* `COPY`
148+
* `LOCK`
149+
* `MKCOL`
150+
* `MOVE`
151+
* `PROPFIND`
152+
* `PROPPATCH`
153+
* `UNLOCK`
134154

135-
* removed the ability of the ``AccessDeniedListener`` to render a response. Use the FOSRestBundle or the twig exception controller in complement.
155+
* removed the ability of the `AccessDeniedListener` to render a response.
156+
Use the FOSRestBundle or the twig exception controller in complement.
136157

137158
Before:
138159
```yml
@@ -151,11 +172,14 @@ Upgrading From 1.x To 2.0
151172
exception: true # Activates the FOSRestBundle exception controller
152173
```
153174

154-
* changed the priority of ``RequestBodyParamConverter`` to ``-50``
175+
* changed the priority of `RequestBodyParamConverter` to `-50`
155176

156-
* made silent the ``RequestBodyParamConverter`` when a parameter is optional and it can't resolve it
177+
* made silent the `RequestBodyParamConverter` when a parameter is
178+
optional and it can't resolve it
157179

158-
* removed the ``format_negotiator`` option ``exception_fallback_format``; you can match the ``ExceptionController`` thanks to the ``attributes`` option instead
180+
* removed the `format_negotiator` option `exception_fallback_format`;
181+
you can match the `ExceptionController` thanks to the `attributes`
182+
option instead
159183

160184
Before:
161185
```yml
@@ -178,7 +202,9 @@ Upgrading From 1.x To 2.0
178202
- { path: ^/, fallback_format: html } }
179203
```
180204

181-
* `View::setSerializationContext` and `View::getSerializationContext` have been removed. Use `View::setContext` and `View::getContext` together with the new Context class instead.
205+
* `View::setSerializationContext` and `View::getSerializationContext`
206+
have been removed. Use `View::setContext` and `View::getContext`
207+
together with the new Context class instead.
182208

183209
Before:
184210
```php

0 commit comments

Comments
 (0)