arrays icon indicating copy to clipboard operation
arrays copied to clipboard

Implement value retrieval and checks by predicate callback

Open yus-ham opened this issue 2 years ago • 8 comments

closes #135

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

yus-ham avatar Jan 25 '24 20:01 yus-ham

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
@@            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.

codecov[bot] avatar Jan 25 '24 21:01 codecov[bot]

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

yus-ham avatar May 20 '24 18:05 yus-ham

@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.

vjik avatar May 21 '24 08:05 vjik

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.

yus-ham avatar May 21 '24 18:05 yus-ham

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?

vjik avatar May 22 '24 12:05 vjik

Yes makes sense.

samdark avatar May 22 '24 13:05 samdark

I'll continue with it

yus-ham avatar May 22 '24 13:05 yus-ham

done

yus-ham avatar May 22 '24 19:05 yus-ham