Skip to content

feat: AddImplicitVoidInterfaceReturnTypeRector - #4

Merged
acoulton merged 2 commits into
mainfrom
feat-implicit-void
Apr 10, 2026
Merged

feat: AddImplicitVoidInterfaceReturnTypeRector#4
acoulton merged 2 commits into
mainfrom
feat-implicit-void

Conversation

@acoulton

Copy link
Copy Markdown
Member

This new rule will add explicit void return types to interface methods that do not document a return type.

Methods that already have a phpdoc return type (including @return void) or a strict return type will not be affected.

This rule is needed because AddReturnTypeFromPhpDocRector intentionally doesn't add return types if the phpdoc does not specify the @return.

In many projects the absence of a @return tag on an interface means that the method does not return - but it can also be a mistake.

This new rule will add explicit `void` return types to interface
methods that do not document a return type.

Methods that already have a phpdoc return type (including
`@return void`) or a strict return type will not be affected.

This rule is needed because `AddReturnTypeFromPhpDocRector`
intentionally doesn't add return types if the phpdoc does not
specify the `@return`.

In many projects the absence of a `@return` tag on an interface
means that the method does not return - but it can also be
a mistake.
@acoulton
acoulton merged commit 28ec198 into main Apr 10, 2026
3 checks passed
@acoulton
acoulton deleted the feat-implicit-void branch April 10, 2026 10:34
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.

1 participant