@@ -193,17 +193,19 @@ To override non-HTML error output, the Serializer component needs to be installe
193193 $ composer require serializer
194194
195195 The Serializer component has a built-in ``FlattenException `` normalizer
196- (`` ProblemNormalizer ` `) and JSON/XML/CSV/YAML encoders. When your application
196+ (:class: ` Symfony \\ Component \\ Serializer \\ Normalizer \\ ProblemNormalizer `) and JSON/XML/CSV/YAML encoders. When your application
197197throws an exception, Symfony can output it in one of those formats. If you want
198198to change the output contents, create a new Normalizer that supports the
199199``FlattenException `` input::
200200
201201 # src/App/Serializer/MyCustomProblemNormalizer.php
202202 namespace App\Serializer;
203203
204+ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
205+
204206 class MyCustomProblemNormalizer implements NormalizerInterface
205207 {
206- public function normalize($exception, $format = null, array $context = [])
208+ public function normalize($exception, string $format = null, array $context = [])
207209 {
208210 return [
209211 'content' => 'This is my custom problem normalizer.',
@@ -214,7 +216,7 @@ to change the output contents, create a new Normalizer that supports the
214216 ];
215217 }
216218
217- public function supportsNormalization($data, $format = null)
219+ public function supportsNormalization($data, string $format = null)
218220 {
219221 return $data instanceof FlattenException;
220222 }
@@ -252,14 +254,14 @@ configuration option to point to it:
252254 https://symfony.com/schema/dic/services/services-1.0.xsd" >
253255
254256 <framework : config >
255- <framework : error_controller >App\Controller\ErrorController::showAction</framework : error_controller >
257+ <framework : error-controller >App\Controller\ErrorController::showAction</framework : error-controller >
256258 </framework : config >
257259
258260 </container >
259261
260262 .. code-block :: php
261263
262- // config/packages/twig .php
264+ // config/packages/framework .php
263265 $container->loadFromExtension('framework', [
264266 'error_controller' => 'App\Controller\ErrorController::showAction',
265267 // ...
0 commit comments