[12.x] Introducing Arr::hasAll
#55815
Open
+47
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continuation of #55770, #26543
Previously, I made a new attempt to introduce
hasAll
due to frequent needs, but for the wrong target, Collections. Following PR #55770 I am now targeting the correct place, the Arr helper.Example
Although there are manual ways - PHP only, to achieve the same result without relying on the Arr helper, this brings benefits to framework users in favor of having a helper ready to use, without relying on framework macros or PHP codes written when necessary.
Behind the scenes, we ensure that we use the native
has
, so that dot notation is fully supported in it.