diff options
author | Bruce Wells <brucekwells@gmail.com> | 2020-06-03 16:59:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-03 16:59:55 +0300 |
commit | 333a52e9aa64272b0011e108714c93c0f1e0d7db (patch) | |
tree | a1f6985aa44e3af0296989435427d57bc5219add /src/NXP/MathExecutor.php | |
parent | 913cf0a1e8920dbcc18649fa173a0c7e6ba5d5ef (diff) | |
parent | ea898d7a7b85aeb677f81f13784232c99b61808a (diff) |
Merge pull request #4 from neonxp/master
Latest from master
Diffstat (limited to 'src/NXP/MathExecutor.php')
-rw-r--r-- | src/NXP/MathExecutor.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/NXP/MathExecutor.php b/src/NXP/MathExecutor.php index 5fdc78f..8f876dc 100644 --- a/src/NXP/MathExecutor.php +++ b/src/NXP/MathExecutor.php @@ -15,8 +15,9 @@ use NXP\Classes\Calculator; use NXP\Classes\CustomFunction; use NXP\Classes\Operator; use NXP\Classes\Tokenizer; -use NXP\MathExecutorException; +use NXP\Exception\MathExecutorException; use NXP\Exception\DivisionByZeroException; +use NXP\Exception\UnknownVariableException; use ReflectionException; /** @@ -30,7 +31,7 @@ class MathExecutor * * @var array */ - public $variables = []; + private $variables = []; /** * @var Operator[] @@ -403,7 +404,7 @@ class MathExecutor public function getVar(string $variable) { if (!isset($this->variables[$variable])) { - throw new UnknownVariableException("Variable ({$variable}) not set"); + throw new UnknownVariableException("Variable ({$variable}) not set"); } return $this->variables[$variable]; } @@ -444,7 +445,7 @@ class MathExecutor return $this; } - /** + /** * Remove variable from executor * * @param string $variable @@ -452,7 +453,7 @@ class MathExecutor */ public function removeVar(string $variable) : self { - unset ($this->variables[$variable]); + unset($this->variables[$variable]); return $this; } |