Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
13 | public static function parseFile(string $filename, string $extension): array { |
||
14 | $pattern = '/' . self::$delimiter . '(.+?)' . self::$delimiter . '(.+?)' . self::$delimiter . 'end' . self::$delimiter . '/s'; |
||
15 | $templateString = self::importFromFile($filename, $extension); |
||
16 | \preg_match_all($pattern, $templateString, $templateArray); |
||
17 | $iterationNumber = count($templateArray[0]); |
||
18 | for ($i = 0; $i < $iterationNumber; $i++) { |
||
19 | self::$parsedJs[$templateArray[1][$i]] = $templateArray[2][$i]; |
||
20 | } |
||
21 | return $templateArray; |
||
22 | } |
||
34 |