From 8a2cae984f77ed55195bed071b12a165fa532561 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Mon, 27 Jul 2020 12:25:59 -0400 Subject: Better setVar error message (#70) Additional unit tests Readme update --- src/NXP/MathExecutor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/NXP/MathExecutor.php') diff --git a/src/NXP/MathExecutor.php b/src/NXP/MathExecutor.php index d23ba80..434246a 100644 --- a/src/NXP/MathExecutor.php +++ b/src/NXP/MathExecutor.php @@ -432,7 +432,8 @@ class MathExecutor public function setVar(string $variable, $value) : self { if (!is_scalar($value)) { - throw new MathExecutorException("Variable ({$variable}) value must be a scalar type ({gettype($value)})"); + $type = gettype($value); + throw new MathExecutorException("Variable ({$variable}) type ({$type}) is not scalar"); } $this->variables[$variable] = $value; -- cgit v1.2.3