fix issue when there is multiple optional args
This commit is contained in:
@@ -80,8 +80,11 @@ abstract class WebService
|
|||||||
$nbArgs = $rm->getNumberOfParameters();
|
$nbArgs = $rm->getNumberOfParameters();
|
||||||
|
|
||||||
/* Check the number of arguments. */
|
/* Check the number of arguments. */
|
||||||
if ($nbArgs != $nbParams && $nbArgsFix != $nbParams) {
|
if ($nbParams < $nbArgsFix) {
|
||||||
throw new WebException ("CallArgNumber", "you must provide " . $nbArgsFix . " arguments", 4);
|
throw new WebException ("CallArgNumber", "you must provide at least " . $nbArgsFix . " arguments", 4);
|
||||||
|
}
|
||||||
|
if ($nbParams > $nbArgs) {
|
||||||
|
throw new WebException ("CallArgNumber", "you must provide at most " . $nbArgs . " arguments", 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->log("Calling '".$this->func."'");
|
$this->log("Calling '".$this->func."'");
|
||||||
|
|||||||
Reference in New Issue
Block a user