Conditions | 3 |
Paths | 2 |
Total Lines | 6 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
53 | 12 | public function resolve(string $template): string |
|
54 | { |
||
55 | 12 | if (0 === strpos($template, '../') || false !== strpos($template, '/../')) { |
|
56 | 3 | throw new InvalidArgumentException('The filename try to escape the current path'); |
|
57 | } |
||
58 | 9 | return $this->directory . '/' . $template . '.' . $this->extension; |
|
59 | } |
||
61 |