1 | <?php |
||
14 | class TwitalLoader implements \Twig_LoaderInterface, \Twig_ExistsLoaderInterface |
||
15 | { |
||
16 | /** |
||
17 | * Array of patterns used to decide if a template is twital-compilable or not. |
||
18 | * Items are strings or callbacks |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $sourceAdapters = array(); |
||
23 | |||
24 | /** |
||
25 | * The wrapped Twig loader |
||
26 | * |
||
27 | * @var \Twig_LoaderInterface |
||
28 | */ |
||
29 | protected $loader; |
||
30 | |||
31 | /** |
||
32 | * The internal Twital compiler |
||
33 | * |
||
34 | * @var Twital |
||
35 | */ |
||
36 | protected $twital; |
||
37 | |||
38 | /** |
||
39 | * Creates a new Twital loader. |
||
40 | * @param \Twig_LoaderInterface $loader |
||
41 | * @param Twital $twital |
||
42 | * @param bool $addDefaults If NULL, some standard rules will be used (`*.twital.*` and `*.twital`). |
||
43 | */ |
||
44 | 32 | public function __construct(\Twig_LoaderInterface $loader = null, Twital $twital = null, $addDefaults = true) |
|
59 | |||
60 | public function getSourceContext($name) |
||
68 | |||
69 | /** |
||
70 | * Add a new pattern that can decide if a template is twital-compilable or not. |
||
71 | * If $pattern is a string, then must be a valid regex that matches the template filename. |
||
72 | * If $pattern is a callback, then must return true if the template is compilable, false otherwise. |
||
73 | * |
||
74 | * @param string|callback $pattern |
||
75 | * @param SourceAdapter $adapter |
||
76 | * @return TwitalLoader |
||
77 | */ |
||
78 | 30 | public function addSourceAdapter($pattern, SourceAdapter $adapter) |
|
84 | |||
85 | /** |
||
86 | * Get all patterns used to choose if a template is twital-compilable or not |
||
87 | * |
||
88 | * @return array: |
||
89 | */ |
||
90 | 1 | public function getSourceAdapters() |
|
94 | |||
95 | /** |
||
96 | * Decide if a template is twital-compilable or not. |
||
97 | * |
||
98 | * @param string $name |
||
99 | * @return SourceAdapter |
||
100 | */ |
||
101 | 25 | public function getSourceAdapter($name) |
|
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | 21 | public function getSource($name) |
|
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | 22 | public function getCacheKey($name) |
|
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function isFresh($name, $time) |
||
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | 2 | public function exists($name) |
|
159 | |||
160 | /** |
||
161 | * Get the wrapped Twig loader |
||
162 | * |
||
163 | * @return \Twig_LoaderInterface |
||
164 | */ |
||
165 | 1 | public function getLoader() |
|
169 | |||
170 | /** |
||
171 | * Set the wrapped Twig loader |
||
172 | * |
||
173 | * @param \Twig_LoaderInterface $loader |
||
174 | * @return TwitalLoader |
||
175 | */ |
||
176 | 1 | public function setLoader(\Twig_LoaderInterface $loader) |
|
182 | |||
183 | /** |
||
184 | * @return Twital |
||
185 | */ |
||
186 | 20 | public function getTwital() |
|
194 | |||
195 | } |
||
196 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.