Skip to content

Commit

Permalink
Merge branch '2.x'
Browse files Browse the repository at this point in the history
* 2.x:
  clean up the readme file
  Improve deprecations DX
  • Loading branch information
xabbuh committed Jun 3, 2020
2 parents 11dae50 + cc53e99 commit 2554a05
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
17 changes: 17 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,23 @@ private function addExceptionSection(ArrayNodeDefinition $rootNode): void
->fixXmlConfig('message', 'messages')
->addDefaultsIfNotSet()
->canBeEnabled()
->validate()
->always()
->then(function ($v) {
if (!$v['enabled']) {
return $v;
}

if ($v['exception_listener']) {
@trigger_error('Enabling the "fos_rest.exception.exception_listener" option is deprecated since FOSRestBundle 2.8.', E_USER_DEPRECATED);
}
if ($v['serialize_exceptions']) {
@trigger_error('Enabling the "fos_rest.exception.serialize_exceptions" option is deprecated since FOSRestBundle 2.8.', E_USER_DEPRECATED);
}

return $v;
})
->end()
->children()
->booleanNode('map_exception_codes')
->defaultFalse()
Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ This bundle provides various tools to rapidly develop RESTful API's &
applications with Symfony. Features include:

- A View layer to enable output and format agnostic Controllers
- A custom route loader to generate url's following REST conventions
- Accept header format negotiation including handling for custom mime types
- RESTful decoding of HTTP request body and Accept headers
- Exception controller for sending appropriate HTTP status codes
- Map exception codes to HTTP response status codes
- A serializer error renderer that returns exceptions and errors in a format
compatible with RFC 7807 using the Symfony Serializer component or the
JMS Serializer

[![Build Status](https://travis-ci.org/FriendsOfSymfony/FOSRestBundle.svg?branch=master)](https://travis-ci.org/FriendsOfSymfony/FOSRestBundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/FriendsOfSymfony/FOSRestBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/FriendsOfSymfony/FOSRestBundle/?branch=master)
Expand All @@ -17,18 +19,12 @@ applications with Symfony. Features include:
[![Latest Stable Version](https://poser.pugx.org/FriendsOfSymfony/rest-bundle/v/stable.svg)](https://packagist.org/packages/FriendsOfSymfony/rest-bundle)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/0be23389-2e85-49cf-b333-caaa36d11c62/mini.png)](https://insight.sensiolabs.com/projects/0be23389-2e85-49cf-b333-caaa36d11c62)

Note
----

FOSRestBundle 1.x is no longer maintained, 1.8 only receives security fixes. Please upgrade to FOSRestBundle 2.x as soon as possible.

Documentation
-------------

[Read the Documentation](http://symfony.com/doc/master/bundles/FOSRestBundle/index.html)

Please see the [UPGRADING-3.0.md](https://github.com/FriendsOfSymfony/FOSRestBundle/blob/master/UPGRADING-3.0.md) for any
relevant instructions when upgrading to a newer version.
Please see the upgrade files (`UPGRADING-X.X.md`) for any relevant instructions when upgrading to a newer version.

Installation
------------
Expand Down

0 comments on commit 2554a05

Please sign in to comment.