From a041bb58ad02db7905a5a23de372eb811ee66dd1 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Thu, 4 Aug 2022 05:18:48 -0700 Subject: [PATCH] More code style fixes (#118) --- src/NXP/Classes/CustomFunction.php | 3 +++ 1 file changed, 3 insertions(+) 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 @@ public function execute(array &$stack, int $paramCountInStack) : Token if ($paramCountInStack < $this->requiredParamCount) { throw new IncorrectNumberOfFunctionParametersException($this->name); } + if ($paramCountInStack > $this->totalParamCount && ! $this->isVariadic) { throw new IncorrectNumberOfFunctionParametersException($this->name); }