diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-09-15 22:21:04 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-09-15 22:21:04 +0200 |
commit | 71176122872e7d200167cd77d48ed30fda95b3ae (patch) | |
tree | 99a5f37ab70d66a5fa222fd0e114899751aa662b /src/ste/VariableNode.php | |
parent | 76a1e915e0eea54b9b9a01d921efa6f9edffb3a8 (diff) | |
download | ste-71176122872e7d200167cd77d48ed30fda95b3ae.tar.gz ste-71176122872e7d200167cd77d48ed30fda95b3ae.tar.bz2 ste-71176122872e7d200167cd77d48ed30fda95b3ae.zip |
Add some unit tests for the parser
So far only testing success, we should also test failing parse inputs.
Diffstat (limited to 'src/ste/VariableNode.php')
-rw-r--r-- | src/ste/VariableNode.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ste/VariableNode.php b/src/ste/VariableNode.php index f5a0b26..cdffc3f 100644 --- a/src/ste/VariableNode.php +++ b/src/ste/VariableNode.php @@ -8,7 +8,21 @@ class VariableNode extends ASTNode public $name; /** @var ASTNode[][] */ - public $arrayfields = []; + public $arrayfields; + + /** + * @param string $tpl + * @param int $off + * @param string $name + * @param ASTNode[][] $arrayfields + */ + public function __construct(string $tpl, int $off, string $name, array $arrayfields) + { + parent::__construct($tpl, $off); + + $this->name = $name; + $this->arrayfields = $arrayfields; + } /** * @return string |