Template   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createCached() 0 4 1
A __construct() 0 9 1
1
<?php
2
3
namespace Zenstruck\ControllerUtil;
4
5
/**
6
 * Helper class to ease creation of template views.
7
 *
8
 * @author Kevin Bond <[email protected]>
9
 */
10
class Template extends View
11
{
12
    /**
13
     * @param string|array $template
14
     * @param int          $sharedMaxAge
15
     * @param array        $parameters
16
     * @param int          $statusCode
17
     *
18
     * @return static
19
     */
20 1
    public static function createCached($template, $sharedMaxAge, $parameters = array(), $statusCode = self::DEFAULT_STATUS_CODE)
21
    {
22 1
        return new static($template, $parameters, $statusCode, array('s_maxage' => $sharedMaxAge));
23
    }
24
25
    /**
26
     * @param string|array $template
27
     * @param mixed        $parameters
28
     * @param int          $statusCode
29
     * @param array        $cache
30
     * @param array        $headers
31
     */
32 5
    public function __construct(
33
        $template,
34
        $parameters = array(),
35
        $statusCode = self::DEFAULT_STATUS_CODE,
36
        array $cache = array(),
37
        array $headers = array()
38
    ) {
39 5
        parent::__construct($parameters, $statusCode, $template, $cache, $headers);
40 5
    }
41
}
42