1 | <?php |
||
13 | class Render |
||
14 | { |
||
15 | /** |
||
16 | * @var TwigCreator |
||
17 | */ |
||
18 | private $twigCreator; |
||
19 | /** |
||
20 | * @var ConfigDAO |
||
21 | */ |
||
22 | private $configDAO; |
||
23 | |||
24 | /** |
||
25 | * Construct. |
||
26 | * |
||
27 | * @param TwigCreator $twig |
||
28 | * @param ConfigDAO $configDAO |
||
29 | */ |
||
30 | 4 | public function __construct(TwigCreator $twig, ConfigDAO $configDAO) |
|
35 | |||
36 | /** |
||
37 | * @param Root $root |
||
38 | * @param $target |
||
39 | * @param $templatePath |
||
40 | * @throws \Twig_Error_Loader |
||
41 | * @throws \Twig_Error_Runtime |
||
42 | * @throws \Twig_Error_Syntax |
||
43 | */ |
||
44 | public function render(Root $root, $target, $templatePath = null): void |
||
65 | |||
66 | /** |
||
67 | * @param string $templatePath |
||
68 | * @param string $target |
||
69 | */ |
||
70 | private function copyAssets($templatePath, $target): void |
||
82 | |||
83 | /** |
||
84 | * @param string $path |
||
85 | */ |
||
86 | private function createDirIfNotExist($path): void |
||
92 | |||
93 | /** |
||
94 | * @param string $base |
||
95 | * @param string $actual |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | private function assetsPath($base, $actual): string |
||
103 | |||
104 | /** |
||
105 | * @param File $file |
||
106 | * @param \Twig_Environment $twig |
||
107 | * @param $target |
||
108 | * @param $basePath |
||
109 | * @throws \Twig_Error_Loader |
||
110 | * @throws \Twig_Error_Runtime |
||
111 | * @throws \Twig_Error_Syntax |
||
112 | */ |
||
113 | private function renderFile(File $file, \Twig_Environment $twig, $target, $basePath): void |
||
130 | |||
131 | /** |
||
132 | * @param Directory $directory |
||
133 | * @param Root $root |
||
134 | * @param \Twig_Environment $twig |
||
135 | * @param $target |
||
136 | * @throws \Twig_Error_Loader |
||
137 | * @throws \Twig_Error_Runtime |
||
138 | * @throws \Twig_Error_Syntax |
||
139 | */ |
||
140 | private function renderDirectory(Directory $directory, Root $root, \Twig_Environment $twig, $target): void |
||
158 | } |
||
159 |