Passed
Push — master ( 6e0c79...d2b237 )
by
unknown
05:05
created

ParserFallback::hasTemplateDefinition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/*************************************************************************************/
3
/*      This file is part of the Thelia package.                                     */
4
/*                                                                                   */
5
/*      Copyright (c) OpenStudio                                                     */
6
/*      email : [email protected]                                                       */
7
/*      web : http://www.thelia.net                                                  */
8
/*                                                                                   */
9
/*      For the full copyright and license information, please view the LICENSE.txt  */
10
/*      file that was distributed with this source code.                             */
11
/*************************************************************************************/
12
namespace Thelia\Core\Template\Parser;
13
14
use Thelia\Core\HttpFoundation\Request;
15
use Thelia\Core\Template\ParserInterface;
16
use Thelia\Core\Template\TemplateDefinition;
17
18
/**
19
 * Class ParserFallback
20
 * @author manuel raynaud <[email protected]>
21
 */
22
class ParserFallback implements ParserInterface
23
{
24
    public function render($realTemplateName, array $parameters = array(), $compressOutput = true)
25
    {
26
        $this->throwException();
27
    }
28
29
    public function renderString($templateText, array $parameters = array(), $compressOutput = true)
30
    {
31
        $this->throwException();
32
    }
33
34
    public function getStatus()
35
    {
36
        $this->throwException();
37
    }
38
39
    public function setStatus($status)
40
    {
41
        $this->throwException();
42
    }
43
44
    /**
45
     * Setup the parser with a template definition, which provides a template description.
46
     *
47
     * @param TemplateDefinition $templateDefinition
48
     */
49
    public function setTemplateDefinition(TemplateDefinition $templateDefinition, $fallbackToDefaultTemplate = false)
50
    {
51
        $this->throwException();
52
    }
53
54
    /**
55
     * Get template definition
56
     *
57
     * @param bool $webAssetTemplate Allow to load asset from another template
58
     *                               If the name of the template if provided
59
     *
60
     * @return TemplateDefinition
61
     */
62
    public function getTemplateDefinition($webAssetTemplate = false)
63
    {
64
        $this->throwException();
65
    }
66
67
    /**
68
     * Check if template definition is not null
69
     *
70
     * @return boolean
71
     */
72
    public function hasTemplateDefinition()
73
    {
74
        $this->throwException();
75
    }
76
77
    /**
78
     * Add a template directory to the current template list
79
     *
80
     * @param int $templateType the template type (
81
     *
82
     * @param string $templateName the template name
83
     * @param string $templateDirectory path to the template dirtectory
84
     * @param string $key ???
85
     * @param bool $unshift ??? Etienne ?
86
     */
87
    public function addTemplateDirectory($templateType, $templateName, $templateDirectory, $key, $unshift = false)
88
    {
89
        $this->throwException();
90
    }
91
92
    /**
93
     * Return the registeted template directories for a givent template type
94
     *
95
     * @param  int $templateType
96
     * @throws \InvalidArgumentException if the templateType is not defined
97
     * @return array:                    an array of defined templates directories for the given template type
98
     */
99
    public function getTemplateDirectories($templateType)
100
    {
101
        $this->throwException();
102
    }
103
104
    /**
105
     * Create a variable that will be available in the templates
106
     *
107
     * @param string $variable the variable name
108
     * @param mixed $value the value of the variable
109
     */
110
    public function assign($variable, $value = null)
111
    {
112
        $this->throwException();
113
    }
114
115
    /**
116
     * @return \Thelia\Core\Template\TemplateHelperInterface the parser template helper instance
117
     */
118
    public function getTemplateHelper()
119
    {
120
        $this->throwException();
121
    }
122
123
    private function throwException()
124
    {
125
        throw new \RuntimeException('if you want to use a parser, please register one');
126
    }
127
128
    /**
129
     * Returns the request used by the parser
130
     *
131
     * @return Request
132
     */
133
    public function getRequest()
134
    {
135
        $this->throwException();
136
    }
137
138
    /**
139
     * Set a new template definition, and save the current one
140
     *
141
     * @param TemplateDefinition $templateDefinition
142
     * @param bool $fallbackToDefaultTemplate if true, resources will be also searched in the "default" template
143
     * @throws \SmartyException
144
     */
145
    public function pushTemplateDefinition(TemplateDefinition $templateDefinition, $fallbackToDefaultTemplate = false)
146
    {
147
        $this->throwException();
148
    }
149
150
    /**
151
     * Restore the previous stored template definition, if one exists.
152
     *
153
     * @throws \SmartyException
154
     */
155
    public function popTemplateDefinition()
156
    {
157
        $this->throwException();
158
    }
159
160
    /**
161
     * Get the current status of the fallback to "default" feature
162
     *
163
     * @return bool
164
     */
165
    public function getFallbackToDefaultTemplate()
166
    {
167
        $this->throwException();
168
    }
169
}
170