Skip to content

refactor(support): clarify has and contains methods #1296

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

Merged
merged 1 commit into from
Jun 23, 2025

Conversation

innocenzi
Copy link
Member

This pull request changes the name of the has and contains array utilities to clarify what they do. Everytime I use them, I have to look them to to find out which one looks for a key, a value or accepts a callback.

  • has is now hasKey
  • A new hasValue method checks for the existence of a value
  • contains now supports a closure and has better types
  • includes is an alias to contains (if you work a lot with JavaScript, you know)

@innocenzi innocenzi merged commit 7597029 into tempestphp:main Jun 23, 2025
65 checks passed
@innocenzi innocenzi deleted the refactor/arr-has branch June 23, 2025 13:19
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 this pull request may close these issues.

1 participant