diff options
Diffstat (limited to 'src/NXP/Classes/CustomFunction.php')
-rw-r--r-- | src/NXP/Classes/CustomFunction.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/NXP/Classes/CustomFunction.php b/src/NXP/Classes/CustomFunction.php index 43c5b55..85db379 100644 --- a/src/NXP/Classes/CustomFunction.php +++ b/src/NXP/Classes/CustomFunction.php @@ -16,7 +16,9 @@ class CustomFunction public $function; private bool $isVariadic; + private int $totalParamCount; + private int $requiredParamCount; /** @@ -45,6 +47,7 @@ class CustomFunction if ($paramCountInStack < $this->requiredParamCount) { throw new IncorrectNumberOfFunctionParametersException($this->name); } + if ($paramCountInStack > $this->totalParamCount && ! $this->isVariadic) { throw new IncorrectNumberOfFunctionParametersException($this->name); } |