Skip to content
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

Implement value retrieval and checks by predicate callback #142

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

yus-ham
Copy link

@yus-ham yus-ham commented Jan 25, 2024

closes #135

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

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@vjik vjik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix psalm errors? Seems it shows problems in code...

@yus-ham yus-ham force-pushed the enh-getValue branch 3 times, most recently from 142b6d0 to ff4a7fa Compare May 20, 2024 18:20
@yus-ham
Copy link
Author

yus-ham commented May 20, 2024

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

@vjik vjik added the status:code review The pull request needs review. label May 21, 2024
@vjik
Copy link
Member

vjik commented May 21, 2024

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

Copy link
Member

@vjik vjik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now closure will be inconsistent in getValue() and other methods:

  • toArray()
  • index()
  • getColumn()
  • map()

Is there real case for getValue() with closure that implement in current PR?

@yus-ham
Copy link
Author

yus-ham commented May 21, 2024

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
Copy link
Member

vjik commented May 22, 2024

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
Copy link
Member

samdark commented May 22, 2024

Yes makes sense.

@yus-ham
Copy link
Author

yus-ham commented May 22, 2024

I'll continue with it

@vjik vjik added status:under development Someone is working on a pull request. and removed status:code review The pull request needs review. labels May 22, 2024
@yus-ham
Copy link
Author

yus-ham commented May 22, 2024

done

@yus-ham yus-ham changed the title Implement value retrieval by matcher Implement value retrieval and checks by predicate callback May 22, 2024
src/ArrayHelper.php Show resolved Hide resolved
src/ArrayHelper.php Outdated Show resolved Hide resolved
src/ArrayHelper.php Outdated Show resolved Hide resolved
src/ArrayHelper.php Outdated Show resolved Hide resolved
src/ArrayHelper.php Outdated Show resolved Hide resolved
src/ArrayHelper.php Outdated Show resolved Hide resolved
src/ArrayHelper.php Outdated Show resolved Hide resolved
src/ArrayHelper.php Outdated Show resolved Hide resolved
src/ArrayHelper.php Outdated Show resolved Hide resolved
src/ArrayHelper.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:under development Someone is working on a pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get array value by matcher
3 participants