Completed
Push — master ( 044f4e...849b11 )
by Lukas Kahwe
04:34
created

TemplatingExceptionController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 30
ccs 0
cts 12
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
findTemplate() 0 1 ?
1
<?php
2
3
/*
4
 * This file is part of the FOSRestBundle package.
5
 *
6
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\RestBundle\Controller;
13
14
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
15
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
16
use Symfony\Component\HttpFoundation\Request;
17
18
abstract class TemplatingExceptionController extends ExceptionController
19
{
20
    protected $templating;
21
22
    public function __construct(
23
        ExceptionWrapperHandlerInterface $exceptionWrapperHandler,
24
        FormatNegotiator $formatNegotiator,
25
        ViewHandlerInterface $viewHandler,
26
        array $exceptionCodes,
27
        array $exceptionMessages,
28
        $showException,
29
        EngineInterface $templating
30
    ) {
31
        parent::__construct($exceptionWrapperHandler, $formatNegotiator, $viewHandler, $exceptionCodes, $exceptionMessages, $showException);
32
33
        $this->templating = $templating;
34
    }
35
36
    /**
37
     * Finds the template for the given format and status code.
38
     *
39
     * @param Request $request
40
     * @param string  $format
41
     * @param int     $statusCode
42
     * @param bool    $showException
43
     *
44
     * @return TemplateReference
45
     */
46
    abstract protected function findTemplate(Request $request, $format, $statusCode, $showException);
47
}
48