1、preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated
image.png解决方法:
找到报错的位置:\thinkphp\library\think\Loader.php
image.png
改成:
image.png
2、
image.png解决办法:
model中引入的
use think\model;
改成
use think\console\command\make\Model;
3、类型错误: preg_match(): Argument #2 ($subject) must be of type string, array given
解决办法:
找到文件位置:\thinkphp\library\think\console\Command.php 466
this->diy_to_string($name)
/**
* 验证指令名称
* @param string $name
* @throws \InvalidArgumentException
*/
private function validateName($name)
{
if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $this->diy_to_string($name))) {
throw new \InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name));
}
}
function diy_to_string($variable)
{
return is_float($variable)?(string)$variable:(is_resource($variable)?"'resource of type'":var_export($variable, true));
}
网友评论