Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

Commit 9f97ed3

Browse files
author
xwm
committed
[FIX] validate number of required arguments
1 parent aadd3f4 commit 9f97ed3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Classes/Cli/Dispatcher.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ protected function runCommand($command){
127127

128128
$method = new ReflectionMethod(get_class($this),$command);
129129

130+
131+
//check number of required arguments
132+
if($method->getNumberOfRequiredParameters() !== count($args)){
133+
throw new InvalidArgumentException('Wrong number of arguments');
134+
}
135+
130136
foreach($method->getParameters() as $param){
131137

132138
if($param->isOptional()){

0 commit comments

Comments
 (0)