-
-
Notifications
You must be signed in to change notification settings - Fork 12
chore: remove occurrences of empty()
#72
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
Conversation
`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.
empty()
(#374)empty()
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.
It is a small think but !$a['b'] is also very generous what it is matching.
Or do you intend to make sure it is defined and not being 'true'?
switched to |
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.
Thank you.
Instead of counting, we can compare arrays with an empty array.
src/platform/src/Bridge/Anthropic/Contract/AssistantMessageNormalizer.php
Outdated
Show resolved
Hide resolved
src/platform/src/Bridge/Bedrock/Nova/Contract/AssistantMessageNormalizer.php
Outdated
Show resolved
Hide resolved
found some other places as well --- hope i found all |
Cherry picking php-llm/llm-chain#374