We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP版本:8.3.15
路由 config/route.php
Route::get("/$name/read/{id}", [$controller, 'read'])
控制器
public function read(Request $request, int|string $id) : Response { ………………………… }
这里 $id 对应了路由里面的 {id} ,访问的时候会出现 Error: Call to undefined method ReflectionUnionType::getName() in ./vendor/workerman/webman-framework/src/App.php:429 Stack trace:
如果我只用 int 或者 string 修饰 $id ,则不会出现报错。
The text was updated successfully, but these errors were encountered:
目前不支持控制器参数设置为支持联合类型
Sorry, something went wrong.
No branches or pull requests
PHP版本:8.3.15
路由 config/route.php
控制器
这里 $id 对应了路由里面的 {id} ,访问的时候会出现
Error: Call to undefined method ReflectionUnionType::getName() in ./vendor/workerman/webman-framework/src/App.php:429
Stack trace:
如果我只用 int 或者 string 修饰 $id ,则不会出现报错。
The text was updated successfully, but these errors were encountered: