Replies: 2 comments 3 replies
-
Hey @drupol, this looks good! I have two suggestions:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Very nice! But there's a small mistake: the date is wrong, also in the actual release notes. "Released on the 11th December |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm opening the discussion for drafting the upcoming changelog for the upcoming version 7 of
loophp/collection
🎉 🥳Estimate date of release: 11 December 2022
Overall feeling
A year without update.
Released on the 11th December 2021, 6.0.3 was the last update.
Today, we are pleased to announce the release of version 7, our first update in over a year. There were several reasons for the delay, including a lack of bug reports and the busy schedules of our team members. We also wanted to take the time to carefully test and prepare the release, given the significant changes and improvements included in this update.
We hope you enjoy this update, and we look forward to continuing to improve and evolve our library in the coming months and years. Please let us know if you have any feedback or suggestions.
Notable changes
PHP 7.4 support has ended the 28 November 2022, therefore, it's time to support PHP 8. Rector has been used to upgrade the codebase with all the new PHP 8 stuff.
We were using a docker-compose file to have the documentation built locally, but since I'm using more and more Nix, I decided to get rid of Docker. With one single file
.envrc
, all the dependencies we need to built the documentation server, creating changelogs with auto-changelogs, running Sphinx server for documentation and have a proper PHP interpreter.For many reasons, we decided to switch to PHPUnit for testing. Switching to the PHPUnit framework was the opportunity to rewrite all the tests and we are extremelly grateful towards the PHPUnit framework. We also built a specific PHPUnit plugin providing assertions for iterables. To built it, we had to abstract the main classes in use in
loophp/collection
in their own project, and that project contains now many Iterator aggregates now in use inloophp/collection
.CollectionDecorator
abstract class to create custom collection classesSince the beginning of the creation of this library, many people expressed the will to not set the main Collection class as
final
. While I'm absolutely not for that, I'm more keen to provide anabstract
class which acts as a decorator and that can be easily extended by using the inheritance mechanism.Averages
,Compare
,Max
,Min
A couple of new operations has been added, please read the API documentation to learn more about them.
IteratorAggregate
Many operations are now using
IteratorAggregate
fromloophp/iterators
.cache
operation is using the fastest implementation of Caching iterators existing. I couldn't find a fastest implementation yet. That implementation is available inloophp/iterators
as an Iterator aggregate. Special thanks to @azjezz for the discussion and tips.BC Breaking changes (
git log 6.0.3.. --grep="BREAKING"
)unfold
constructor is not variadic anymore #269The static constructor is no more variadic. We noticed that when using
unfold
, there were some of useless kind of back and forth when it comes to callback arguments handling. Return value is an array, which is expanded, then converted again into an array... that mambo jambo is useless, it has been removed.scanLeft1
operation. #245The
ScanLeft1
has always been something that was bugging me out in the edge cases. I was unable to find an elegant way to deal with it when the Collection was empty since we were usingPrepend
in it. This issue has been fixed now. The implementation is not the best, but it works very well.The operations:
first
,foldLeft
,foldLeft1
,foldRight
,foldRight1
,implode
,reduce
,unlines
,unwords
,last
,head
,get
,compare
,min
,max
are now returning a value instead of returning a Collection containing one single value. That feature request has been requested many times ago by many users, this is now done.Tails
operation is now keeping keys.The
Tails
operation used to return a list of values, it is now returning value keys has well. The implementation is way cleaner and faster has well.Numbers
git log 6.0.3.. --pretty=oneline | wc -l
)Random
This year I decided to participate to the Advent Of Code and guess what... I'm using
loophp/collection
for finding solutions to the challenges. It turns out that this is actually an excellent tool. I also have in mind to create a dedicated documentation section with the solutions when the challenge is over. In the meantime, you can have a look at the aoc2022 repository and get some inspirations.A new badge "Try It Online" on the README has been added. It uses https://play.phpsandbox.io/ and provides a live playground where you can test the library online in a full blown text editor with auto-completion !
Beta Was this translation helpful? Give feedback.
All reactions