Skip to content

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

@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
@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