aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/MathExecutor.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/NXP/MathExecutor.php')
-rw-r--r--src/NXP/MathExecutor.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/NXP/MathExecutor.php b/src/NXP/MathExecutor.php
index 9e7ce25..c5c7add 100644
--- a/src/NXP/MathExecutor.php
+++ b/src/NXP/MathExecutor.php
@@ -91,6 +91,10 @@ class MathExecutor
*/
public function setVar($variable, $value)
{
+ if (!is_numeric($value)) {
+ throw new \Exception("Variable ({$variable}) value must be a number ({$value}) type ({gettype($value)})");
+ }
+
$this->variables[$variable] = $value;
return $this;