Skip to content
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

Merged
merged 8 commits into from
Jun 18, 2021

Conversation

assert6
Copy link
Member

@assert6 assert6 commented Jun 18, 2021

#[Middlewares(TestMiddleware::class, Test2Middleware::class)]

@limingxinleo
Copy link
Member

文档这里标一下吧。。

@limingxinleo
Copy link
Member

代码测试过了是吧

@limingxinleo limingxinleo self-requested a review June 18, 2021 09:24
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不是 Bug,是 变更

@limingxinleo limingxinleo merged commit 0d2b45c into hyperf:2.2 Jun 18, 2021
@assert6 assert6 deleted the 2.2-middlewares branch June 18, 2021 10:20
@@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这种写法怎么支持 #[Middleware] 里面再加参数呢?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FooMiddleware,BarMiddleware

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我的意思是,比如说 #[Middleware(priority=1)] 这种情况,就是 Middleware 注解有参数的场景

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants