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