- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Describe the bug
When doing return new parent()
, the code reports:
--------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------- 267 | WARNING | Empty set of arbitrary parentheses found. | | (Generic.WhiteSpace.ArbitraryParenthesesSpacing.FoundEmpty) ---------------------------------------------------------------------------------------------------------------------
Code sample
public function generalize(GeneralizePrecision $precision): Type { return new parent(); }
Custom ruleset
https://github.com/phpstan/phpstan-src/blob/adf7313ac266ef217cf144fc4901a2998ead4df2/phpcs.xml
Expected behavior
No error should be reported. New with parentheses is required by SlevomatCodingStandard.ControlStructures.NewWithParentheses.MissingParentheses.
Versions (please complete the following information):
- OS: macOS 12.4
- PHP: 8.1.4
- PHPCS: 3.7.1
- Standard: see custom ruleset
Additional context
Add any other context about the problem here.