diff options
author | Javier Marín <javier@marinros.com> | 2020-09-16 04:08:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 04:08:14 +0300 |
commit | 8aa6674831c7c2329d06b8dc9db7801cb4997695 (patch) | |
tree | b7785e26ac4ee3f597a898a8463552170c0f4794 /src/NXP | |
parent | f8faf3fa8d21ebd6e6f8c73f022eb64e407dc6e1 (diff) |
Allow null values in `setVar` method (#73)V2.1.3
* Added handler to define not found variables
Added support for string variables
Fixed strings and ints comparison error
* Check if variables have scalar types (int, float, string and bool)
Better $onVarNotFound logic
* Better support for null variables
* Better support for null variables
* Better support for null variables
* Allow null values in `setVar` method
Diffstat (limited to 'src/NXP')
-rw-r--r-- | src/NXP/MathExecutor.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/NXP/MathExecutor.php b/src/NXP/MathExecutor.php index f45335c..b7abcad 100644 --- a/src/NXP/MathExecutor.php +++ b/src/NXP/MathExecutor.php @@ -431,7 +431,7 @@ class MathExecutor */ public function setVar(string $variable, $value) : self { - if (!is_scalar($value)) { + if (!is_scalar($value) && $value !== null) { $type = gettype($value); throw new MathExecutorException("Variable ({$variable}) type ({$type}) is not scalar"); } |