<p dir="auto">I've noticed one common piece of code when I have to write a redirect:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="return new RedirectResponse($this-&gt;router-&gt;generate('app.example', [...]));"><pre class="notranslate"><span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">RedirectResponse</span>(<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">router</span>-&gt;<span class="pl-en">generate</span>(<span class="pl-s">'app.example'</span>, [...]));</pre></div>
<p dir="auto">What I would like to write is something similar to:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="return new RoutedRedirectResponse('app.example', [...]);"><pre class="notranslate"><span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">RoutedRedirectResponse</span>(<span class="pl-s">'app.example'</span>, [...]);</pre></div>
<p dir="auto">The actual route would be generated at a later stage and use the default router.</p>
<p dir="auto">I run my app with Symfony 2.6. Whin I have a exception, this message is thrown.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PHP Fatal error:  Cannot redeclare class Symfony\Component\Debug\Exception\FlattenException in /home/baptiste/Project/pole-gestion.fr/vendor/symfony/symfony/src/Symfony/Component/Debug/Exception/FlattenException.php on line 25"><pre class="notranslate"><code class="notranslate">PHP Fatal error:  Cannot redeclare class Symfony\Component\Debug\Exception\FlattenException in /home/baptiste/Project/pole-gestion.fr/vendor/symfony/symfony/src/Symfony/Component/Debug/Exception/FlattenException.php on line 25
</code></pre></div>
<p dir="auto">I think that it's linked at the inclusion of FlattenException into Symfony\Component\HttpKernel\Exception\FlattenException which is deprecated.</p>