Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
33 | public function get($file) |
||
34 | { |
||
35 | $basepath = $this->config['basepath']; |
||
36 | $suffix = $this->config['suffix']; |
||
37 | $target = "$basepath/$file{$suffix}"; |
||
38 | |||
39 | if (!is_readable($target)) { |
||
40 | throw new \Exception(t("No such file content: @FILENAME", ["@FILENAME" => $target])); |
||
41 | } |
||
42 | |||
43 | $filter = $this->config['textfilter']; |
||
44 | $content = file_get_contents($target); |
||
45 | $content = $this->di->textFilter->doFilter($content, $filter); |
||
46 | |||
47 | return $content; |
||
48 | } |
||
49 | |||
85 |