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

Add new manipulation and analyze methods for collections. #44

Merged
merged 9 commits into from
Dec 30, 2018
Merged

Add new manipulation and analyze methods for collections. #44

merged 9 commits into from
Dec 30, 2018

Conversation

icanhazstring
Copy link
Contributor

Solve #13.

This will add the following methods:

  • column
  • first
  • last (additionally to first)
  • sort
  • filter
  • where
  • map
  • diff
  • intersect
  • unique
  • merge

The methods have been implemented according to the suggested API. If you want any change to these methods. Keep me posted.

This will add the following methods: columns, first, last, sort, filter,
where, map, diff, intersect, unique, merge
Added a phpstan.neon to be able to validate prophecy calls.
Copy link
Contributor

@jmauerhan jmauerhan left a comment

Choose a reason for hiding this comment

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

Overall I love it.

I would remove the unique as we still have some discussion about that one, and also increase why comments on some of the code and tests, but then I'm happy :)

@icanhazstring
Copy link
Contributor Author

Will update after I got my little girl to sleep ;)

@jmauerhan
Copy link
Contributor

jmauerhan commented Oct 5, 2018 via email

@icanhazstring
Copy link
Contributor Author

Yep. I just changed it to use the internal array pointer with current() and end() performance should be much better then.

This will now used the internal array pointer instead of copying
the whole collection. This should improve the performance
Remove unique() method for now, as the definition of "uniqueness"
is still under discussion
This should cover all possible outcomes of the ValueExtractorTrait
This will separate the tests for manipulating a collection
from the default operations. This should make sure everyone knows
what these tests are doing and why they are doing what they do ;)
src/CollectionInterface.php Outdated Show resolved Hide resolved
src/AbstractCollection.php Show resolved Hide resolved
src/AbstractCollection.php Show resolved Hide resolved
This will call some internal functions from root namespace
to benefit from opcode optimization
@icanhazstring
Copy link
Contributor Author

icanhazstring commented Oct 24, 2018

@jmauerhan as you requested changes, can you give it another look?
Maybe we can merge this then.

Copy link
Contributor

@jmauerhan jmauerhan left a comment

Choose a reason for hiding this comment

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

I think the one exception name should be changed but otherwise good. @ramsey ?

@icanhazstring
Copy link
Contributor Author

@jmauerhan renamed the exception.
@ramsey if we are good you can merge it :)

@ramsey ramsey merged commit 0db4d75 into ramsey:master Dec 30, 2018
@icanhazstring
Copy link
Contributor Author

Awesome. Thank you 😊

@jmauerhan
Copy link
Contributor

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants