diff options
author | Bruce Wells <brucekwells@gmail.com> | 2020-04-10 05:06:58 +0300 |
---|---|---|
committer | Bruce Wells <brucekwells@gmail.com> | 2020-04-10 05:22:37 +0300 |
commit | e7add2d36dce3a25389e359bd53e4b5ebc6160f9 (patch) | |
tree | e61d76954437062412493fb6436bf092ed4e4b40 /src/NXP/MathExecutor.php | |
parent | 4955c639e1069ba3d3415d01a3368f09b000c2a7 (diff) |
Update documentation for PHPFUI/InstaDoc
Diffstat (limited to 'src/NXP/MathExecutor.php')
-rw-r--r-- | src/NXP/MathExecutor.php | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/src/NXP/MathExecutor.php b/src/NXP/MathExecutor.php index 9d3f5e8..e9ce0ed 100644 --- a/src/NXP/MathExecutor.php +++ b/src/NXP/MathExecutor.php @@ -133,6 +133,7 @@ class MathExecutor /** * Remove all variables + * @return MathExecutor */ public function removeVars() { @@ -196,7 +197,6 @@ class MathExecutor * Set division by zero exception reporting * * @param bool $exception default true - * * @return MathExecutor */ public function setDivisionByZeroException($exception = true) @@ -256,25 +256,36 @@ class MathExecutor $this->setVars($this->defaultVars()); } + /** + * Get the default operators + * + * @return array of class names + */ protected function defaultOperators() { return [ - 'NXP\Classes\Token\TokenPlus', - 'NXP\Classes\Token\TokenMinus', - 'NXP\Classes\Token\TokenMultiply', - 'NXP\Classes\Token\TokenDivision', - 'NXP\Classes\Token\TokenDegree', - 'NXP\Classes\Token\TokenAnd', - 'NXP\Classes\Token\TokenOr', - 'NXP\Classes\Token\TokenEqual', - 'NXP\Classes\Token\TokenNotEqual', - 'NXP\Classes\Token\TokenGreaterThanOrEqual', - 'NXP\Classes\Token\TokenGreaterThan', - 'NXP\Classes\Token\TokenLessThanOrEqual', - 'NXP\Classes\Token\TokenLessThan', + \NXP\Classes\Token\TokenPlus::class, + \NXP\Classes\Token\TokenMinus::class, + \NXP\Classes\Token\TokenMultiply::class, + \NXP\Classes\Token\TokenDivision::class, + \NXP\Classes\Token\TokenDegree::class, + \NXP\Classes\Token\TokenAnd::class, + \NXP\Classes\Token\TokenOr::class, + \NXP\Classes\Token\TokenEqual::class, + \NXP\Classes\Token\TokenNotEqual::class, + \NXP\Classes\Token\TokenGreaterThanOrEqual::class, + \NXP\Classes\Token\TokenGreaterThan::class, + \NXP\Classes\Token\TokenLessThanOrEqual::class, + \NXP\Classes\Token\TokenLessThan::class, ]; } + /** + * Gets the default functions as an array. Key is function name + * and value is the function as a closure. + * + * @return array + */ protected function defaultFunctions() { return [ @@ -413,6 +424,11 @@ class MathExecutor ]; } + /** + * Returns the default variables names as key/value pairs + * + * @return array + */ protected function defaultVars() { return [ |