Skip to content

Releases: loophp/collection

7.3.0

10 Dec 19:23
ed5ef20
Compare
Choose a tag to compare

Merged

  • fix: pair and chunk operation when using empty input #327
  • Breaking change: feat: update Collection::fromFile constructor #322
  • feat: add dispersion operation #320
  • Improve return types for psalm #321
  • feat: add entropy operation #317
  • doc: fix duplicate example #315
  • docs: fix light color code everywhere where it was white #312
  • docs: fix light color code over light gray background #311

Fixed

  • fix: pair and chunk operation when using empty input (#327) #326

Commits

7.2.1

06 Sep 06:39
5321ebc
Compare
Choose a tag to compare

Merged

  • feat: add countIn operation #306
  • feat: add length parameter to fromFile constructor #307
  • chore(deps): update cachix/install-nix-action action to v23 #308
  • chore(deps): update actions/checkout action to v4 #309

Commits

  • ci: switch to DeterminateSystems/nix-installer-action 6a4374b
  • chore: update .editorconfig d700df0
  • refactor: range operation may now yield int|float instead of float 64ba910
  • chore: autofix code style f346796
  • doc: add fizz-buzz example 4d3d325
  • doc: fix groupBy example 55f1989

7.2.0

11 Aug 18:48
1bfd964
Compare
Choose a tag to compare

Merged

  • chore(deps): update cachix/install-nix-action action to v22 #305
  • Update lazy-json-parsing.php #301
  • chore(deps): update actions/stale action to v8 #300
  • chore(deps): update cachix/install-nix-action action to v20 #299

Commits

  • ci: update, add composer.json ff6299f
  • chore: minimum PHP version is 8.1 309f4b0
  • cs: autofix code style 13ef487
  • chore: autofix cs 3847ab0
  • cs: autofix codestyle 2cdf128
  • tests: migrate phpunit configuration 52540ff
  • static-analysis: minor update 3c06179
  • tests: update Psalm configuration file. a081ef1
  • fix: update parameter type to satisfy PSalm 5.8.0 9ad6d0f
  • style: remove headers d062040

7.1.2

16 Feb 16:37
Compare
Choose a tag to compare

Commits

  • fix: refactor DropWhile, Since, Until operations for better performance 0e8ffa8

7.1.1

15 Feb 21:28
958202c
Compare
Choose a tag to compare

Commits

  • refactor: TakeWhile - simplify things 9d4bee7
  • refactor: TakeWhile: do not use CachingIteratorAggregate 09eb135
  • style: autofix codestyle 61f15cd

7.1.0

09 Feb 20:38
30682ef
Compare
Choose a tag to compare

Merged

  • ci: add missing pcov extension #297
  • chore(deps): update cachix/install-nix-action action to v19 #296
  • Psalm 5.4 upgrade #287
  • IsNotEmpty operation #292
  • Fix reducing operations #288
  • chore(deps): update actions/stale action to v7 #286

Commits

  • chore: update clover coverage 5b510c2
  • chore: fix phpunit 9 and 10 compatibility 0273e64
  • chore: fix phpunit 9 and 10 compatibility 2a62cf2
  • chore: fix phpunit 9 and 10 compatibility 631a57f
  • chore: fix phpunit 9 and 10 compatibility cd9b36d
  • chore: fix phpunit 10 compatibility 3aab1e1
  • chore: update composer.json 70f95b6
  • chore: bump Psalm 5dd2a88
  • fix: find operation 50d416a
  • chore: bump vimeo/psalm temporarily 1aca436
  • fix: autofix code style 29b0456
  • fix: unfold static operations a429c78
  • chore: remove obsolete PHPDoc annotations 531249e
  • chore: update PHPStan baseline 999c257
  • fix: foldRight operation f717078
  • fix: groupBy update typing information b55fec7
  • chore: update groupBy b5662f4
  • sa: update PHPStan baseline 61f6367
  • fix: Matching operation, add inline SA annotations e9cc0f3
  • chore: update license date 755f8b3
  • fix: update empty constructor 9a4b0bb
  • fix: foldleft, reduce, update return types and tests 19907fc
  • fix: foldleft operation c3a536b
  • cs: autofix code style 507175d
  • fix: last operation improvements 7c60e2c
  • fix: tails SA improvement 8e3de94
  • fix: tails operation improvements 58c840b
  • fix: compare minor improvement 5e46af0
  • fix: reduce operation static annotations 5c7d401
  • fix: convert callable into Closure f30c87a
  • fix: reduce operation, use ReduceIterableIterator 884f64c
  • chore: remove obsolete PHPDoc annotations 0453ee3
  • ci: update workflows 6f320a6
  • fix: prevent wrapping and unwrapping arrays when it's not needed 08af31b
  • docs: fix badge link 3571e0c
  • fix: prevent wrapping and unwrapping arrays when it's not needed 937740d
  • ci: fix PDF documentation generation 92f778c
  • docs: update extending collection section with code example 0c1d439
  • ci: fix PDF documentation generation c93f350

7.0.0

12 Dec 21:41
c6b9164
Compare
Choose a tag to compare

Overall feeling 🐈

A year and one day 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 🎉

  • Minimum version of PHP is now 8
    PHP 7.4 support has ended the 28 November 2022, therefore, it's time to support PHP 8. [Rector][rectorphp repository] has been used to upgrade the codebase with all the new PHP 8 stuff.
  • Removal of docker, switch to [Nix][nix website]
    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.
  • Removal of PHPSpec, switch to PHPunit
    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 in loophp/collection.
  • New CollectionDecorator abstract class to create custom collection classes
    Since 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 an abstract class which acts as a decorator and that can be easily extended by using the inheritance mechanism.
  • Add new operations: Averages, Compare, Max, Min
    A couple of new operations has been added, please read the API documentation to learn more about them.
  • Use of IteratorAggregate
    Many operations are now using IteratorAggregate from loophp/iterators.
  • The cache operation is using the fastest implementation of Caching iterators existing. I couldn't find a fastest implementation yet. That implementation is available in loophp/iterators as an Iterator aggregate. Special thanks to @azjezz for the discussion and tips.
  • Static analysis coverage has been greatly improved, we are now around 99.2%

BC Breaking changes 💣

  • #269
    The 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.
  • #245
    The 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 using Prepend in it. This issue has been fixed now. The implementation is not the best, but it works very well.
  • #249
    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.
  • The 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 🔢

Random 👍

  • [Advent Of Code 2022][aoc website]
    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][aoc2022 repository] repository and get some inspirations.
  • Try It Online!
    A new badge [![Try!][phpsandbox image]][phpsandbox link] 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 !

Merged

  • Psalm 5 upgrade #283
  • add AbstractCollection abstract class #270
  • chore(deps): update dependency sphinx_rtd_theme to v0.5.2 #275
  • chore(deps): update actions/stale action to v6 #276
  • chore(deps): add renovate.json #274
  • refactor: unfold constructor is not variadic anymore #269
  • Documentation: refactoring #266
  • chore(deps): Bump cachix/install-nix-action from 17 to 18 #267
  • Breaking change: refactor: Refactor Reduce operation. #259
  • Add action on README file. #263
  • chore(deps): Bump shivammathur/setup-php from 2.20.1 to 2.21.1 #261
  • chore(deps): Bump shivammathur/setup-php from 2.19.0 to 2.20.1 #258
  • New Operations: Compare, Max, Min #255
  • chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.19.0 #253
  • ci: Use pcov for coverage. #252
  • chore(deps-dev): Update psr/cache requirement from ^1.0 to ^1.0 || ^2.0 #251
  • chore(deps): Bump shivammathur/setup-php from 2.18.0 to 2.18.1 #250
  • Update Scrutinizer configuration. #249
  • chore(deps): Bump actions/stale from 4 to 5 #248
  • feat: Add Averages operation. #238
  • Simplify every operation #247
  • Get rid of phpspec/prophecy-phpunit. #246
  • Breaking change: fix: Update scanLeft1 operation. #245
  • chore(deps): Bump shivammathur/setup-php from 2.17.1 to 2.18.0 #244
  • refactor: Update every operation. #242
  • chore(deps): Bump actions/cache from 2.1.7 to 3 #243
  • misc: Update CallbackArrayReducer. #241
  • chore(deps): Bump actions/checkout from 2.4.0 to 3 #240
  • chore(deps): Bump shivammathur/setup-php from 2.17.0 to 2.17.1 #239
  • chore(deps): Bump shivammathur/setup-php from 2.16.0 to 2.17.0 #235
  • Replace Iterator with iterable almost everywhere. #233
  • refactor: Use new keyword on some operations. #231
  • refactor: Use StringIteratorAggregate. #234
  • Tests: Switch to PHPUnit #227
  • Refactor: Replace RandomIterator #230
  • Simplify operations that needs more than one instance of the Generator - using IteratorAggregate. #229
  • Use loophp/iterators #228

Fixed

  • tests: Add new tests. #264

Commits

  • Breaking change: refactor: Tails operation, performance improvements d71b2ef
  • Breaking change: refactor: Update Unpack operation. 34c36da
  • chore: update composer.json and fix auto-changelog command 6949831
  • chore: update composer.json 1ba6085
  • remove obsolete annotation [908d3e5](908d3e5...
Read more

6.0.3

11 Dec 18:11
7e22909
Compare
Choose a tag to compare

Merged

  • Fix intersperse operation. #226

Commits

  • refactor: Improve Intersperse operation. a208d4c

Thank @SebLours for its first contribution in #226 !

6.0.2

30 Nov 20:59
e9373e6
Compare
Choose a tag to compare

6.0.2 - 2021-11-30

Merged

  • chore(deps): Bump shivammathur/setup-php from 2.15.0 to 2.16.0 #223
  • chore(deps): Bump actions/cache from 2.1.6 to 2.1.7 #222
  • [PHPStan Baseline] A few small fixes #220
  • Fix PHP 8.1 Deprecations #225

Commits

  • docs: Add/update CHANGELOG. 88faf68
  • cs: Autofix code style. 77f161d
  • cs: Autofix code style. d8d812b
  • sa: Improve static analysis score. db0073e
  • cs: Autofix code style. ab5cac3

6.0.1

12 Nov 08:45
3142f23
Compare
Choose a tag to compare

Merged

  • Update docs version #219
  • Template param order matters? #218