From e03df64281a1c33639b13c9f490d4452c1a1784d Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Thu, 10 Jan 2019 20:29:20 -0500 Subject: Fixed function argument ordering and default parameter type for addFunction Updated unit tests Fixed docs --- src/NXP/Classes/Token/TokenFunction.php | 2 +- src/NXP/MathExecutor.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/NXP') diff --git a/src/NXP/Classes/Token/TokenFunction.php b/src/NXP/Classes/Token/TokenFunction.php index b2866c3..d61bb5d 100644 --- a/src/NXP/Classes/Token/TokenFunction.php +++ b/src/NXP/Classes/Token/TokenFunction.php @@ -32,7 +32,7 @@ class TokenFunction extends AbstractContainerToken implements InterfaceFunction $args = []; list($places, $function) = $this->value; for ($i = 0; $i < $places; $i++) { - array_push($args, array_pop($stack)->getValue()); + $args[] = array_shift($stack)->getValue(); } $result = call_user_func_array($function, $args); diff --git a/src/NXP/MathExecutor.php b/src/NXP/MathExecutor.php index 29c6a64..6325d35 100644 --- a/src/NXP/MathExecutor.php +++ b/src/NXP/MathExecutor.php @@ -174,7 +174,7 @@ class MathExecutor * @return MathExecutor * @throws \ReflectionException */ - public function addFunction($name, $function = null, $places = 1) + public function addFunction($name, $function = null, $places = null) { $this->tokenFactory->addFunction($name, $function, $places); -- cgit v1.2.3