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

What is the point of all the useless if statements in the codebase? #8914

Closed
jack-worman opened this issue Dec 17, 2022 · 3 comments · Fixed by #8916
Closed

What is the point of all the useless if statements in the codebase? #8914

jack-worman opened this issue Dec 17, 2022 · 3 comments · Fixed by #8916

Comments

@jack-worman
Copy link
Contributor

What is the point of writing code like this:

if (IssueBuffer::accepts(new NoEnumProperties(
    'Enums cannot have properties',
    new CodeLocation($this, $prop),
    $fq_class_name
))) {
    // fall through
}

When it can be written without the if statement:

IssueBuffer::accepts(new NoEnumProperties(
    'Enums cannot have properties',
    new CodeLocation($this, $prop),
    $fq_class_name
));
@psalm-github-bot
Copy link

Hey @jack-worman, can you reproduce the issue on https://psalm.dev ?

@jack-worman
Copy link
Contributor Author

I see #7020, so I assume that was just an old practice.

@weirdan
Copy link
Collaborator

weirdan commented Dec 17, 2022

It is.

@weirdan weirdan closed this as completed Dec 17, 2022
@weirdan weirdan reopened this Dec 17, 2022
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