1 | <?php |
||
11 | abstract class AbstractFileBasedTemplate extends AbstractTemplate |
||
12 | { |
||
13 | /** @var null|string */ |
||
14 | private $filePath; |
||
15 | |||
16 | /** |
||
17 | * @param array $variables |
||
18 | * @param null|string $filePath |
||
19 | * @throws InvalidArgumentException |
||
20 | * @throws RuntimeException |
||
21 | */ |
||
22 | public function __construct($variables = array(), $filePath = null) |
||
28 | |||
29 | /** |
||
30 | * @param array $variables |
||
31 | * @param null $filePath |
||
32 | * @return string |
||
33 | * @throws InvalidArgumentException |
||
34 | * @throws RuntimeException |
||
35 | */ |
||
36 | public function __invoke($variables = array(), $filePath = null) |
||
42 | |||
43 | /** |
||
44 | * @param string $filePath |
||
45 | * @throws InvalidArgumentException |
||
46 | * @throws RuntimeException |
||
47 | */ |
||
48 | public function setFilePath($filePath) |
||
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | * @throws RuntimeException |
||
64 | */ |
||
65 | protected function getContent() |
||
81 | |||
82 | /** |
||
83 | * @return null|string |
||
84 | */ |
||
85 | protected function getFilePath() |
||
89 | |||
90 | /** |
||
91 | * @param string $filePath |
||
92 | * @throws RuntimeException |
||
93 | */ |
||
94 | protected function throwRuntimeExceptionIfFilePathIsInvalid($filePath) |
||
114 | |||
115 | /** |
||
116 | * @param null|string $filePath |
||
117 | * @throws RuntimeException |
||
118 | */ |
||
119 | protected function setFilePathIfProvided($filePath = null) |
||
125 | } |