From 5ee6bbbf3002daf075fa77007daccf4d2af25241 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Sun, 13 Sep 2020 21:30:39 +0200 Subject: Fix some issues reported by PhpStorm --- src/ste/ParseCompileError.php | 3 ++- src/ste/STEStandardLibrary.php | 2 +- src/ste/Scope.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ste/ParseCompileError.php b/src/ste/ParseCompileError.php index 29590da..0d5a240 100644 --- a/src/ste/ParseCompileError.php +++ b/src/ste/ParseCompileError.php @@ -16,7 +16,8 @@ class ParseCompileError extends \Exception $this->msg = $msg; $this->tpl = $tpl; $this->off = $offset; - $this->message = "$msg (Template $tpl, Offset $offset)"; + + parent::__construct("$msg (Template $tpl, Offset $offset)", $code, $previous); } /** diff --git a/src/ste/STEStandardLibrary.php b/src/ste/STEStandardLibrary.php index f28ccc0..fcd1cd2 100644 --- a/src/ste/STEStandardLibrary.php +++ b/src/ste/STEStandardLibrary.php @@ -51,7 +51,7 @@ class STEStandardLibrary if (empty($params["array"])) { throw new RuntimeError("Missing array parameter in ."); } - $a = $ste->get_var_by_name($params["array"], false); + $a = $ste->get_var_by_name($params["array"]); return (is_array($a)) ? count($a) : ""; } diff --git a/src/ste/Scope.php b/src/ste/Scope.php index afb2bfc..15d7d6c 100644 --- a/src/ste/Scope.php +++ b/src/ste/Scope.php @@ -184,7 +184,7 @@ class Scope implements \ArrayAccess public function offsetExists($offset) { try { - $this->get_topvar_reference($offset); + $this->get_topvar_reference($offset, false); return true; } catch (VarNotInScope $e) { return false; -- cgit v1.2.3-70-g09d2