Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | protected static function getJavaScriptFileContents($filename) |
||
22 | { |
||
23 | static $files = []; |
||
24 | |||
25 | if (empty($files[$filename])) { |
||
26 | $path = str_replace('Utils', 'JavaScript', __DIR__) . "/$filename.js"; |
||
27 | |||
28 | if (!file_exists($path)) { |
||
29 | throw new \RuntimeException(sprintf('File "%s" does not exists!', $path)); |
||
30 | } |
||
31 | |||
32 | $files[$filename] = file_get_contents($path); |
||
33 | } |
||
34 | |||
35 | return $files[$filename]; |
||
36 | } |
||
37 | } |
||
38 |