yiisoft / arrays

Yii Array Helper
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
52 stars 28 forks source link

Implement value retrieval and checks by predicate callback #142

Open yus-ham opened 10 months ago

yus-ham commented 10 months ago
closes #135 Q A
Is bugfix?
New feature? ✔️
Breaks BC?
codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.77%. Comparing base (36bf7a5) to head (6135f7f). Report is 9 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #142 +/- ## ========================================= Coverage 99.76% 99.77% - Complexity 214 226 +12 ========================================= Files 4 4 Lines 429 445 +16 ========================================= + Hits 428 444 +16 Misses 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

yus-ham commented 6 months ago

@vjik, @samdark its now now only one is reds. i don't know why it still fails

vjik commented 6 months ago

@vjik, @samdark its now now only one is reds. i don't know why it still fails

It's OK. We have a problem with GitHub action "rector" in forks. It don't work in forks.

yus-ham commented 6 months ago

There is a PHP RFC: array_find and its PR that is what actually I need to be implemented.

It seems has been discussed about a month ago and I found exactly it just now. Now Its OK if this PR would be rejected, or if not, I can continue to push some changes and because this changes has BC and so on. so what if introduce new method instead, maybe find()

Thank you in advance for taking your time.

vjik commented 6 months ago

There is a PHP RFC: array_find and its PR that is what actually I need to be implemented.

It's interesting. May be we keep getValue() as is, but add new methods:

ArrayHelper::find()
ArrayHelper::findKey()
ArrayHelper::any()
ArrayHelper::all()

@samdark @yus-ham What do you think?

samdark commented 6 months ago

Yes makes sense.

yus-ham commented 6 months ago

I'll continue with it

yus-ham commented 6 months ago

done