今日更新后 运行报错 运行环境PHP8.3
Method 'Webman\Http\Request::file()' is not compatible with method 'Workerman\Protocols\Http\Request::file()'
Worker process terminated with ERROR: E_COMPILE_ERROR "Declaration of Webman\Http\Request::file($name = null) must be compatible with Workerman\Protocols\Http\Request::file(?string $name = null): mixed in D:\MyCode\BackEnd\ErpServer\vendor\workerman\webman-framework\src\Http\Request.php on line 119"
PHP Fatal error: Declaration of Webman\Http\Request::file($name = null) must be compatible with Workerman\Protocols\Http\Request::file(?string $name = null): mixed in D:\MyCode\BackEnd\ErpServer\vendor\workerman\webman-framework\src\Http\Request.php on line 119
/**
* File
* @param string|null $name
* @return null|UploadFile[]|UploadFile
*/
public function file($name = null)
{
$files = parent::file($name);
if (null === $files) {
return $name === null ? [] : null;
}
if ($name !== null) {
// Multi files
if (is_array(current($files))) {
return $this->parseFiles($files);
}
return $this->parseFile($files);
}
$uploadFiles = [];
foreach ($files as $name => $file) {
// Multi files
if (is_array(current($file))) {
$uploadFiles[$name] = $this->parseFiles($file);
} else {
$uploadFiles[$name] = $this->parseFile($file);
}
}
return $uploadFiles;
}
"php": ">=7.2",
"workerman/webman-framework": "1.6.4",
"monolog/monolog": "^2.0",
"illuminate/database": "^11.27",
"laravel/serializable-closure": "^1.3",
"illuminate/pagination": "^11.32",
"psr/container": "^2.0",
"php-di/php-di": "^7.0",
"doctrine/annotations": "^2.0",
"illuminate/redis": "^11.32",
"illuminate/events": "^11.29",
"vlucas/phpdotenv": "^5.6"
执行
composer require workerman/webman-framework ^1.6.6
嗯 可以了 应该是阿里源的问题 最新在1.6.4 更换源后 就能更新到1.6.6了