1 | <?php |
||
18 | class TemplateFactory implements TemplateFactoryInterface |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * @var string[] |
||
23 | */ |
||
24 | protected static $cachedTemplates = []; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | protected static $templates = []; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $templatesPath; |
||
35 | |||
36 | /** |
||
37 | * TemplateFactory constructor. |
||
38 | * |
||
39 | * @param string $templatesPath |
||
40 | */ |
||
41 | public function __construct(string $templatesPath = self::DEFAULT_TEMPLATE_DIR) |
||
45 | |||
46 | /** |
||
47 | * @inheritDoc |
||
48 | */ |
||
49 | public static function registerTemplate(CodeceptionTestType $type, string $suite, string $path) |
||
54 | |||
55 | /** |
||
56 | * @param string $path |
||
57 | * |
||
58 | * @throws TemplateNotFound |
||
59 | */ |
||
60 | protected static function validateTemplatePath(string $path) |
||
66 | |||
67 | /** |
||
68 | * @param string $path |
||
69 | * |
||
70 | * @return TemplateInterface |
||
71 | * @throws FileNotFoundException |
||
72 | */ |
||
73 | public function getTemplate(string $path) : TemplateInterface |
||
77 | |||
78 | /** |
||
79 | * @param string $path |
||
80 | * |
||
81 | * @return string |
||
82 | * @throws FileNotFoundException |
||
83 | */ |
||
84 | private function resolveTemplate(string $path) : string |
||
91 | |||
92 | /** |
||
93 | * @param string $path |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | protected function resolveTemplatePath(string $path) : string |
||
101 | |||
102 | /** |
||
103 | * @param string $path |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | protected function prepareTemplatePath(string $path) : string |
||
113 | |||
114 | } |
||
115 |