Ensure Lexer:: is always initialized

This commit is contained in:
Daniel Gorgan
2024-04-18 13:17:11 +03:00
committed by Fabien Potencier
parent 7d2b814e6c
commit 5a79652e7c
+2 -2
View File
@@ -71,8 +71,6 @@ class Lexer
return;
}
$this->isInitialized = true;
// when PHP 7.3 is the min version, we will be able to remove the '#' part in preg_quote as it's part of the default
$this->regexes = [
// }}
@@ -160,6 +158,8 @@ class Lexer
'interpolation_start' => '{'.preg_quote($this->options['interpolation'][0], '#').'\s*}A',
'interpolation_end' => '{\s*'.preg_quote($this->options['interpolation'][1], '#').'}A',
];
$this->isInitialized = true;
}
public function tokenize(Source $source): TokenStream