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

refactor: [Rector] Apply ExplicitBoolCompareRector #8704

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Apr 3, 2024

Description

Make if conditions more explicit and reduce phpstan baseline errors.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@samsonasik
Copy link
Member Author

Ready to review 👍

Copy link
Member

@paulbalandan paulbalandan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure abt the change in strings to === '' and === '0'. Are we really checking for non-falsy-string? Or maybe just non-empty-string?

For the others, I think I'm good with those changes.

@samsonasik
Copy link
Member Author

This is the exact equal truthy check to string, which should be safer.

if it only check on empty string "", I can change

system/CLI/CLI.php Outdated Show resolved Hide resolved
system/Config/DotEnv.php Outdated Show resolved Hide resolved
@kenjis kenjis added the refactor Pull requests that refactor code label Apr 3, 2024
@kenjis kenjis changed the title chore: [Rector] Apply ExplicitBoolCompareRector refactor: [Rector] Apply ExplicitBoolCompareRector Apr 3, 2024
@samsonasik
Copy link
Member Author

@kenjis I updated to remove !== "0" check 👍

@samsonasik
Copy link
Member Author

Ready to merge 👍

@samsonasik
Copy link
Member Author

Let's merge it, thank you @paulbalandan @kenjis for the review 👍

@samsonasik samsonasik merged commit 57c0c5a into codeigniter4:develop Apr 4, 2024
55 checks passed
@samsonasik samsonasik deleted the rector-explicit-bool branch April 4, 2024 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants