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

For non-void functions, forbid bare return #563

Closed
quasilyte opened this issue Jul 4, 2020 · 1 comment
Closed

For non-void functions, forbid bare return #563

quasilyte opened this issue Jul 4, 2020 · 1 comment

Comments

@quasilyte
Copy link
Contributor

Code Example

/**
 * @return string|null
 */
function f($x) {
  if (!$x) {
    return; // Better to write as "return null"
  }
  // ...
}

Actual Behavior

No warnings.

Expected Behavior

Suggest explicit return null. Functions with void results should be ignored.

@i582
Copy link
Contributor

i582 commented Aug 28, 2021

Will be tracked further in #1123.

@i582 i582 closed this as completed Aug 28, 2021
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 a pull request may close this issue.

2 participants