Conditions | 3 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
63 | 12 | public function resolve($template) |
|
64 | { |
||
65 | 12 | if (0 === strpos($template, '../') || false !== strpos($template, '/../')) { |
|
66 | 3 | throw new \InvalidArgumentException('The filename try to escape the current path'); |
|
67 | } |
||
68 | 9 | return $this->directory . '/' . $template . '.' . $this->extension; |
|
69 | } |
||
70 | } |
||
71 |