str_repeat(): Second argument has to be greater than or equal to 0
跟踪堆栈后定位在 vendor/topthink/fr
$spacingWidth = $width - strlen($name);
$this->writeText(sprintf(" <info>%s</info>%s%s", $name, str_repeat(' ', $spacingWidth), $desc
->getDesc
看了下 这个$width是取所有命令获取最长的脚本名称,但它的集合里面,是取脚本里面设置的name,如果这个name和console.php配置的不一致, 是不会存在这个集合里面,而是放在了一个别名里面:
if ($command->getName() === $name) {
$this->commands[$name] = $command;
} else {
$this->aliases[$name] = $command;
}
我试了一下 ,name中和console.php配置相同名字 ,只是大小写不一样, 读取不到, 就报错了, 这个错误可否优化一下,不然要看下源码
最佳答案