@@ -3,9 +3,9 @@ |
||
3 | 3 | namespace ntentan\honam\factories; |
4 | 4 | |
5 | 5 | use ntentan\honam\template_engines\AbstractEngine; |
6 | +use ntentan\honam\template_engines\MustacheEngine; |
|
6 | 7 | use ntentan\honam\template_engines\mustache\MustacheLoader; |
7 | 8 | use ntentan\honam\template_engines\mustache\MustachePartialsLoader; |
8 | -use ntentan\honam\template_engines\MustacheEngine; |
|
9 | 9 | |
10 | 10 | |
11 | 11 | class MustacheEngineFactory implements EngineFactoryInterface |
@@ -33,6 +33,11 @@ discard block |
||
33 | 33 | array_unshift($this->pathHierarchy, $path); |
34 | 34 | } |
35 | 35 | |
36 | + /** |
|
37 | + * @param string $testTemplate |
|
38 | + * @param string[] $paths |
|
39 | + * @param string $extension |
|
40 | + */ |
|
36 | 41 | private function testTemplateFile($testTemplate, $paths, $extension) |
37 | 42 | { |
38 | 43 | $templateFile = ''; |
@@ -46,6 +51,10 @@ discard block |
||
46 | 51 | return $templateFile; |
47 | 52 | } |
48 | 53 | |
54 | + /** |
|
55 | + * @param string $testTemplate |
|
56 | + * @param string[] $paths |
|
57 | + */ |
|
49 | 58 | private function testNoEngineTemplateFile($testTemplate, $paths) |
50 | 59 | { |
51 | 60 | $templateFile = ''; |
@@ -53,6 +62,10 @@ discard block |
||
53 | 62 | $newTemplateFile = "$testTemplate.*"; |
54 | 63 | $files = array_filter( |
55 | 64 | scandir($path), |
65 | + |
|
66 | + /** |
|
67 | + * @param string $file |
|
68 | + */ |
|
56 | 69 | function($file) use($newTemplateFile) { |
57 | 70 | return fnmatch($newTemplateFile, $file); |
58 | 71 | }); |
@@ -67,6 +80,9 @@ discard block |
||
67 | 80 | return $templateFile; |
68 | 81 | } |
69 | 82 | |
83 | + /** |
|
84 | + * @param string $template |
|
85 | + */ |
|
70 | 86 | private function searchTemplateDirectory($template, $ignoreEngine = false) |
71 | 87 | { |
72 | 88 | $templateFile = ''; |
@@ -117,7 +117,6 @@ |
||
117 | 117 | * of rendering the view. |
118 | 118 | * |
119 | 119 | * @param string $template The template reference file. |
120 | - * @param array $templateData The data to be passed to the template. |
|
121 | 120 | * @return string |
122 | 121 | * @throws \ntentan\honam\exceptions\FileNotFoundException |
123 | 122 | */ |
@@ -26,8 +26,6 @@ |
||
26 | 26 | |
27 | 27 | namespace ntentan\honam; |
28 | 28 | |
29 | -use ntentan\honam\exceptions\TemplateResolutionException; |
|
30 | - |
|
31 | 29 | /** |
32 | 30 | * The TemplateEngine class does the work of resolving templates, loading template files, |
33 | 31 | * loading template engines and rendering templates. The `ntentan/views` package takes a reference to a |