-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add Reject
operation.
#125
Conversation
bfa1f7f
to
cb8ef1e
Compare
cb8ef1e
to
c796e59
Compare
@drupol if you solve the conflicts here I can give this one a good look as well |
c796e59
to
2b8a228
Compare
Rebased and ready to review! |
reject_checkMap(Collection::fromIterable(['foo' => 'bar', 'baz' => ''])->filter($stringValueCallback, $stringValueCallback2)); | ||
reject_checkMap(Collection::fromIterable(['foo' => 'bar', 'baz' => ''])->filter($stringKeyValueCallback1)); | ||
reject_checkMap(Collection::fromIterable(['foo' => 'bar', 'baz' => ''])->filter($stringKeyValueCallback1, $stringKeyValueCallback2)); | ||
reject_checkList(Collection::fromIterable([1, 2, 3])->reject()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#facepalm ... I should more careful sometimes !
376f2b8
to
71d0732
Compare
$collection = Collection::fromIterable(range(1, 10)) | ||
->reject($divisibleBy2, $divisibleBy3); // [1, 5, 7] | ||
|
||
$collection = Collection::fromIterable(range(1, 10)) | ||
->reject($divisibleBy2) | ||
->reject($divisibleBy3); // [1, 5, 7] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it just me or because of the nature of reject
, calling it with variadic callbacks is the same as calling it multiple times? Acts as logical AND
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes exactly !
Not "A or B" is "Not A and Not B"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing tests 😉
Going to do this tomorrow, I'm out for today. |
On this, I was surprised nothing in the CI workflows alerted us about it. But now I see there's nothing in the workflows to cause it to fail if a certain code coverage % is not reached. Would you want to have something like that? Another two things I noticed looking into the jobs 😄
I can create a separate PR to fix number 2, but not too sure about number 1 |
71d0732
to
99c12d3
Compare
Yes good idea and it's quite easy to do, it's already done here: https://github.com/ecphp/cas-bundle/blob/master/grumphp.yml.dist#L9
Yes this is broken on Windows, and it's "normal". This step is only supposed to be triggered on Linux. This is also why
Yeah I think that could be fixed in a separate PR indeed. |
on this, does it mean that the coverage check is already enforced but the level (80%) is too low so that's why it didn't fail? |
That's for ecphp/cas-bundle project 😄 ! |
Oops misread it, I thought it was on the php-conventions project 😄 |
This PR
Depends on #126
Related to #123