-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
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
support php8 attributes like #[Middlewares(TestMiddleware::class, Tes… #3706
Conversation
…t2Middleware::class)]
文档这里标一下吧。。 |
代码测试过了是吧 |
CHANGELOG-2.2.md
Outdated
@@ -53,3 +53,4 @@ | |||
|
|||
- [#3650](https://github.com/hyperf/hyperf/pull/3650) Fixed bug that `ReflectionParameter::getClass()` will be deprecated in php8. | |||
- [#3692](https://github.com/hyperf/hyperf/pull/3692) Fixed bug that class proxies couldn't be included when building phar. | |||
- [#3706](https://github.com/hyperf/hyperf/pull/3706) Fixed bug that `#[Middlewares]` does not work in PHP8. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个不是 Bug,是 变更
@@ -23,6 +23,7 @@ | |||
- [#3694](https://github.com/hyperf/hyperf/pull/3694) Changed `Hyperf\CircuitBreaker\CircuitBreakerInterface` to support php8. | |||
- Changed `CircuitBreaker::inc*Counter()` to `CircuitBreaker::incr*Counter()`. | |||
- Changed type hint for method `AbstractHandler::switch()`. | |||
- [#3706](https://github.com/hyperf/hyperf/pull/3706) Changed the style of writing to `#[Middlewares(FooMiddleware::class)]` from `@Middlewares({@Middleware(FooMiddleware::class)})` in PHP8. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种写法怎么支持 #[Middleware]
里面再加参数呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FooMiddleware,BarMiddleware
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我的意思是,比如说 #[Middleware(priority=1)]
这种情况,就是 Middleware 注解有参数的场景
#[Middlewares(TestMiddleware::class, Test2Middleware::class)]