PHP8.1 / PHPCS Empty FUNCTION statement detected with constructor property promotion
gmachure opened this issue · 3 comments
gmachure commented
Preconditions
M2.4.4
Steps to reproduce
- Create a php class and add constructor using property promotion like this :
public function __construct(
private readonly string $test1,
private readonly int $test2
)
{ }
- Launch phpcs
Expected result
- No errors
Empty function should be authorized here.
Actual result
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
14 | WARNING | Empty FUNCTION statement detected
m2-assistant commented
Hi @gmachure. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
fredden commented
gmachure commented
Yes you're right. I was using version 24.
Thank you.