-
Notifications
You must be signed in to change notification settings - Fork 24
Conversation
c55c870
to
53e4757
Compare
May i ask why those bool casts are favored instead of replacing I just try to understand the pro and con of this variant 🤔 |
I'm in favor of removing |
Aaah, good reminder, didn't catch that we're using it that often already 😬 I'm in favor of using explicit checks over implicit bool casts as well - at least for errors. And I'm afraid that with merging #369 I created some conflict here |
53e4757
to
d78db53
Compare
Alright! Explicit checks added on arrays |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only make cs
and we're good to go - thanks @alexandre-daubois! :)
d78db53
to
4f31d04
Compare
Ah yes of course, done 🙂 |
…chr-hertel) This PR was merged into the main branch. Discussion ---------- chore: remove occurrences of `empty()` | Q | A | ------------- | --- | Bug fix? | no | New feature? |no | Docs? | no | Issues | | License | MIT Cherry picking php-llm/llm-chain#374 Commits ------- c0d688f chore: use [] checks instead of count with zero on array fb3d1a8 chore: use isset instead of bool cast on $_ENV 14c448c chore: remove occurrences of `empty()` (#374)
…chr-hertel) This PR was merged into the main branch. Discussion ---------- chore: remove occurrences of `empty()` | Q | A | ------------- | --- | Bug fix? | no | New feature? |no | Docs? | no | Issues | | License | MIT Cherry picking php-llm/llm-chain#374 Commits ------- c0d688f chore: use [] checks instead of count with zero on array fb3d1a8 chore: use isset instead of bool cast on $_ENV 14c448c chore: remove occurrences of `empty()` (#374)
…chr-hertel) This PR was merged into the main branch. Discussion ---------- chore: remove occurrences of `empty()` | Q | A | ------------- | --- | Bug fix? | no | New feature? |no | Docs? | no | Issues | | License | MIT Cherry picking php-llm/llm-chain#374 Commits ------- c0d688f chore: use [] checks instead of count with zero on array fb3d1a8 chore: use isset instead of bool cast on $_ENV 14c448c chore: remove occurrences of `empty()` (#374)
…chr-hertel) This PR was merged into the main branch. Discussion ---------- chore: remove occurrences of `empty()` | Q | A | ------------- | --- | Bug fix? | no | New feature? |no | Docs? | no | Issues | | License | MIT Cherry picking php-llm/llm-chain#374 Commits ------- c0d688f chore: use [] checks instead of count with zero on array fb3d1a8 chore: use isset instead of bool cast on $_ENV 14c448c chore: remove occurrences of `empty()` (#374)
empty()
is used less and less in favor of bool casts on arrays. Symfony, for example, banned it from its codebase. I suggest we remove them from here as well.