NullEngine::addPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Veto.
4
 * PHP Microframework.
5
 *
6
 * @author Damien Walsh <[email protected]>
7
 * @copyright Damien Walsh 2013-2014
8
 * @version 0.1
9
 * @package veto
10
 */
11
namespace Veto\Templating\Engine;
12
13
use Veto\Templating\EngineInterface;
14
15
/**
16
 * NullEngine
17
 * A templating engine that does nothing.
18
 *
19
 * @since 0.1
20
 */
21
class NullEngine implements EngineInterface
22
{
23
    /**
24
     * Add a template directory to look for template files inside.
25
     *
26
     * @param string $path The path to a template directory to load templates from.
27
     * @return boolean
28
     */
29
    public function addPath($path)
30
    {
31
        return true;
32
    }
33
34
    /**
35
     * Render the given template name and return the result as a string.
36
     *
37
     * @param string $templateName The name of the template to render
38
     * @param array $parameters Any parameters to render the template with
39
     * @throws \Exception
40
     * @return string
41
     */
42
    public function render($templateName, array $parameters = array())
43
    {
44
        throw new \Exception('NullEngine cannot render templates.');
45
    }
46
}
47