TestController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testErrorPageAction() 0 10 2
1
<?php
2
/*
3
 * (c) webfactory GmbH <[email protected]>
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Webfactory\Bundle\ExceptionsBundle\Controller;
10
11
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
12
use Symfony\Component\HttpKernel\Exception\HttpException;
13
14
/**
15
 * Controller to render your custom exception pages. Accessing it is really simple, e.g. a call to .../405/html will
16
 * render your 405 HTML error page.
17
 */
18
class TestController extends Controller
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Bundle\Framework...e\Controller\Controller has been deprecated with message: since Symfony 4.2, use "Symfony\Bundle\FrameworkBundle\Controller\AbstractController" instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
19
{
20
    /**
21
     * Let the error page for the HTTP status code $code be rendered in the format $format.
22
     *
23
     * @param int $code HTTP error status code
24
     * @throws \Symfony\Component\HttpKernel\Exception\HttpException
25
     */
26
    public function testErrorPageAction($code)
27
    {
28
        $exceptionController = $this->get('twig.controller.exception');
29
30
        if ($exceptionController instanceof ExceptionController) {
31
            $exceptionController->setDebug(false);
32
        }
33
34
        throw new HttpException($code);
35
    }
36
}
37