Skip to content

support php8 attributes like #[Middlewares(TestMiddleware::class, Tes…#3706

Merged
limingxinleo merged 8 commits intohyperf:2.2from
assert6:2.2-middlewares
Jun 18, 2021
Merged

support php8 attributes like #[Middlewares(TestMiddleware::class, Tes…#3706
limingxinleo merged 8 commits intohyperf:2.2from
assert6:2.2-middlewares

Conversation

@assert6
Copy link
Copy Markdown
Member

@assert6 assert6 commented Jun 18, 2021

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

@limingxinleo
Copy link
Copy Markdown
Member

文档这里标一下吧。。

@limingxinleo
Copy link
Copy Markdown
Member

代码测试过了是吧

@limingxinleo limingxinleo self-requested a review June 18, 2021 09:24
CHANGELOG-2.2.md Outdated

- [#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
Copy Markdown
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
- [#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
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
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
Copy Markdown
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