Fatal error: Call to a member function isOption() on null
1franck opened this issue · comments
François Lajoie commented
spec option with multiple values output fatal error when value(s) missing
...
$specs->add('b|bar+', 'option with multiple value.' )->isa('Number');
...
$ php script.php -f foo -b
Fatal error: Call to a member function isOption() on null in ...\vendor\corneltek\getoptionkit\src\GetOptionKit\OptionParser.php on line 187
$ php script.php -f foo -b 1 -b 2
Array
(
[0] => 1
[1] => 2
)
OptionParser.php temp fix
if($next) {
if($next->isOption())
$i++;
$result->set($spec->getId(), $spec);
}
Yo-An Lin commented
Released in 2.1.1