Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Collection Laravel Package

loophp/collection

A high-performance, functional-style collection library for PHP. Provides lazy, immutable, chainable operations built on generators to map, filter, reduce, group, zip, and more. Works standalone or with Laravel, aiming for speed, memory efficiency, and fluent pipelines.

View on GitHub
Deep Wiki
Context7
v17-8448fdd
7.6.1

Merged

  • chore(deps): update dependency infection/infection to ^0.29 #343

Commits

  • perf: improve performance of Chunk and Entropy operations 3e571a0
  • chore: update code style 68e7154
  • chore: update phpstan baseline 947c03e
  • chore: fix composer.json b086f6c
  • documentation: update API page 84f6c5b
v16-a068dee
7.6.0

Merged

  • Adds tap() - allows shorter syntax for chaining no side effects operations #340

Commits

  • fix: doctrine/collections deprecations 5b39b54
v15-b0b4468
7.5.2

Merged

  • refactor: remove obsolete All class #338

Commits

  • refactor: minor SA update Tails operation acb6d8f
v13-179c2a5
7.5.1

Merged

  • loophp/iterators: 3.1.1 -> 3.2.0 #337

Commits

  • chore: autofix code style 2cbba52
v12-b8bfd5a
7.5.0

Merged

  • sort: improve sort operation #334

Commits

  • fix: make sort operation's direction match PHP usort function's direction 3b0f875
  • chore: autofix code style 353f0c2
v11-6ea3c47
7.4.0

Merged

  • feat: implements stable sorting #333
  • chore(deps): update actions/download-artifact action to v4 #329
  • chore(deps): update actions/upload-artifact action to v4 #330
  • chore(deps): update actions/stale action to v9 #328

Fixed

  • feat: implements stable sorting (#333) #331

Commits

7.3.0

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

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

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

Commits

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

Commits

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

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

Overall feeling :cat2:

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 :tada:

  • 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 has been used to upgrade the codebase with all the new PHP 8 stuff.
  • Removal of docker, switch to Nix 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 :bomb:

  • #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 :1234:

Random :+1:

  • Advent Of Code 2022 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.
  • Try It Online! A new badge Try! 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
  • refactor: Tails operation ea4b92c
  • refactor: Tails operation, performance improvements 1c28be3
  • refactor: Window operation: minor performance improvement 486567a
  • refactor: upgrade tests for PHP 8 25067cb
  • refactor: upgrade docs for PHP 8 1d9c134
  • refactor: upgrade src for PHP 8 4a4a60b
  • cs: autofix cs 4dc36fe
  • fix: update IfThenElse operation eb78132
  • sa: update typing information for PHP 8 8ee1134
  • update SA annotations 7154f09
  • update SA annotations 0e8b0e5
  • disable phpcs statement d7bba3a
  • update PHPStan baseline 808578a
  • reorder Collection interface use statements 6bbb829
  • fix: update span and partition operations 31d4b31
  • fix: remove static constructors 747e1f8
  • docs: fix unfold signature d11addd
  • sa: update PSalm baseline f78dc32
  • Revert "sa: fix Wrapable interface" 1cf67d1
  • sa: fix Wrapable interface 3866fe5
  • sa: fix template-extends annotations a3f8b45
  • cs: reduce the amount of use statements 19eb14e
  • cs: reduce the amount of use statements dce7e48
  • Autofix code style. cd4a6f6
  • direnv: update .envrc b402706
  • fix: update constructors c49e62b
  • fix: Update GroupBy static analysis annotations. d74d4f8
  • fix: update various operations static analysis annotations. 473f105
  • fix: update various operations static analysis annotations. c1998e9
  • fix: update various operations static analysis annotations. 2fb44cf
  • fix: Since and Until operation - fix sa bde565c
  • fix: Compare operation - fix sa 06729d7
  • fix: fix operator sign ea90e23
  • fix: remove optional parameters 6a27551
  • fix: update interfaces 0dae4c2
  • fix missing parameter 69818b3
  • docs: Update pipe documentation ec10eeb
  • cs: get rid of obsolete phpcs annotations a385a6a
  • ci: update scrutinizer configuration dae9eb6
  • ci: update scrutinizer configuration ca6f602
  • ci: update scrutinizer configuration 2d09f65
  • ci: update scrutinizer configuration bac7f9b
  • ci: update scrutinizer configuration 376bd66
  • ci: update trigger paths 0f2db5b
  • ci: update scrutinizer configuration 8d12965
  • ci: fix indentation 95e60b5
  • ci: update trigger paths e78546e
  • ci: fix scrutinizer/ocular 583668f
  • Autofix code style. 079a7b9
  • docs: Update changes a6653b8
  • scanLeft and scanRight has been updated and now need two arguments instead of one. 9355dea
  • tests: fix tests 1233c49
  • sa: update SA info of various operations. 25ed050
  • sa: fixes 6c5e44c
  • tests: update diff SA tests ece6067
  • tests: update diff SA tests 0af490e
  • fix typos with codespell 28e7663
  • fix Collatz example 6ec0563
  • chore: remove custom nix files 4197638
  • cs: autofix code style e546136
  • refactor: update Pair operation eed0c7e
  • chore: prettify codebase 2a0ed02
  • refactor: align Duplicate operation with Distinct de09c01
  • docs: do not create ArrayIterator. 806fa18
  • refactor: prevent the creation of an extra variable 31f87a8
  • docs: do not create ArrayIterator. 2e50e49
  • refactor: remove files header aacb5e9
  • Revert "chore: Ignore Nix files" 98fe09a
  • docs: Add phpsandbox badge and link. 9f02c7c
  • docs: Fix minor things. 679b353
  • chore: Update flake.nix file. 8ddd35d
  • chore: Ignore Nix files d34980d
  • ci: Add workflow to build a PDF of the documentation for each tag. 7810400
  • chore: Add composer command to run the documentation server. 15dc6bd
  • docs: Update documentation. a783394
  • chore: Add Nix flakes file for documentation building. 3f90ed6
  • chore: Remove docker stuff. 88e92b6
  • cs: Upgrade to loophp/iterators^2. 1343255
  • refactor: Upgrade to loophp/iterators^2. 691abd4
  • cs: Autofix code style. 6f1eda3
  • chore: Update baseline. 4463a37
  • chore: Update scrutinizer configuration. fc3a790
  • ci: Add prettier in required status checks. c8687cf
  • chore: Prettify codebase. 9551288
  • chore: Update .gitattributes. 411f937
  • ci: Update required status checks. 5ab0f1f
  • ci: Fix step name. a65faf4
  • prettier: Autofix. ff03ea6
  • ci: Fix branch name. bbfb1c8
  • ci: Enable prettier on the whole repo. 25d1c25
  • ci: Simplify things. 1ef0edc
  • sa: Fix distinct tests. 6147f9c
  • ci: Include tests src directories. ff8fea0
  • sa: Fix distinct tests. edc521f
  • chore: Update test workflow. 7f43d4b
  • chore: Update test workflow. 738cc6e
  • Update Filter and Reject operations. 186c003
  • Minor cosmetic changes. 066504a
  • Autofix code style. 25b2a69
  • refactor: Minor optimization in Pack operation. 32462ad
  • fix: Equals operation, fix typing information. eff8102
  • fix: Same operation, fix typing information. 5a91d8a
  • fix: Reduction operation, fix typing information. 466232b
  • Use ReductionIterableAggregate. 0d4d7a2
  • Use ReductionIterableAggregate. a168b6d
  • Autofix code-style. 3b49c3a
  • Revert "Revert last 3 commits." 16e3c7a
  • Update typing information. 3017e2a
  • tests: Disable problematic test on PHP < 8. c148d16
  • Revert last 3 commits. 31cdc99
  • Use ConcatIterableAggregate. d90986d
  • Use MapIterableAggregate. ea45575
  • Use FilterIterableAggregate. 84b42c2
  • fix: Performance improvements using SimpleCachingIteratorAggregate. 51e7d6f
  • fix: Remove [@psalm-suppress](https://github.com/psalm-suppress) annotation. ab5f9f0
  • docs: Add more examples snippets. a1873a7
  • Revert "ci: Disable XDebug." a6b4791
  • ci: Disable XDebug. 447bd03
  • SA: Minor changes fix. 0e30363
  • SA: Minor changes. c835e1c
  • SA: Fix a couple of operations. 679834b
  • SA: PHPStan 1.6.0 upgrade. 843c9c4
  • refactor: Update Reverse operation. 545bd60
  • fix: Remove ext-xdebug from composer.json for now. 6209f4b
  • fix: Minor static analysis fixes. 2ce3510
  • refactor: Minor optimizations here and there. f08d88e
  • refactor: Minor optimizations here and there. e9c4460
  • refactor: Minor optimizations. 5987ab7
  • refactor: random operation: use RandomIterableAggregate. 78e7a6f
  • tests: Add missing test. 8afedbf
  • tests: Add missing test. 7a05041
  • cs: Autofix code style. 0d2595e
  • misc: Further optimizations with Every operations. f523cdb
  • misc: Further optimizations with Every operations. de1edb3
  • tests: Remove duplicated tests. 2a0c84d
  • cs: Minor changes. f0612e7
  • refactor: Optimize Head operation. 33e2f15
  • cs: Autofix code style. 6cc2a05
  • fix: SA - Update Unwindow operation. c9562fd
  • refactor: Simplify and optimize Transpose. 38cca46
  • refactor: Use new keyword everywhere. aacf7df
  • refactor: Use new keyword everywhere. a6db56e
  • refactor: Minor SA annotations update. 35bf8c2
  • refactor: Use new keyword everywhere. 8a3a05a
  • refactor: Remove useless intermediary variable. 79ebed1
  • refactor: Drop rely on Limit now. 16e220a
  • refactor: Remove useless intermediary variable. d6d8aa6
  • refactor: Minor optimizations. 9ac298a
  • refactor: Minor optimizations. 11bee15
  • refactor: Use more iterator aggregates. 19616a6
  • refactor: Use more iterator aggregates. 669a956
  • refactor: Use more iterator aggregates. 7af1d80
  • cs: Cleanup .php-cs-fixer.dist.php. 0fba6da
  • feat: Performance improvements using iterator aggregates. 3b773ad
  • chore: Normalize composer.json. e19bde8
  • tests: TypedIterator - Add test. b9aab65
  • cs: Autofix code style. cbc6c20
  • tests: StringIterator - Add test. fe15a5b
  • tests: StringIterator - Add test. a66242d
  • fix: Disable PHPCSFixer on specific files. eb61a90
  • tests: TypedIterator - Add test. 7280ebc
  • tests: Enable HTML infection reports. 468d71d
  • ci: Update PHP configuration. f54b002
  • Autofix code style. 04d7531
  • Autofix code style. 10e7eed
  • refactor: Unpack operation - Use UnpackIterableAggregate. aaa289a
  • Update license 741cbce
  • Normalize composer.json 8ef547d
  • fix: Add missing from keyword. d179b11
  • Autofix code style. 6df94ee
  • refactor: Minor optimization, remove return keyword. 7683362
  • sa: Update PHPStan baseline. 782a48e
  • sa: Fix unresolvable type. d112149
  • cs: Autofix code style. 78d5d7a
  • sa: Update typing information. 351676b
  • fix: Remove local variable. 58a3919
  • fix: Same operation - proper sign. 15bf8de
  • fix: Same operation must yield. 317b519
  • cs: Same operation, clear remaining todo. 518209b
  • refactor: Simplify fromGenerator operation. b2e1dc9
  • sa: Update typing information to reduce warnings. b2028d8
  • refactor: Simplify DropWhile operation. e794b79
  • test: Add minor test for Sort operation. 1935d11
  • Fix scrutinizer/ocular upload. 5f956e2
  • tests: Only do mutation testing on PHP 8.0. 525e32e
  • docs: Update Contributing section. 36cdcd1
  • ci: Fix scrutinizer/ocular upload. 5e67380
  • docs: Update README. 20a1352
  • ci: Fix Grumphp task name. 4fd27fd
  • docs: Enable badge showing infection tests score. 603eb82
  • ci: Enable infection tests reporting. fed4fbc
  • sa: Improve static analysis score. d11d032
  • refactor: Update Intersperse operation - do not throw when values are negative. 1497db7
  • chore: Update static files. 47eb342
  • chore: Update static files. 401cf20
  • chore: Normalize composer.json. cf34e8d
6.0.3

Merged

  • Fix intersperse operation. #226

Commits

  • refactor: Improve Intersperse operation. a208d4c

Thank @SebLours for its first contribution in #226 !

6.0.2

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

Merged

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

Features :boom:

  • Refactor Current operation - Let specify a default value #205
  • feat: Add Find operation #204

Breaking changes :broken_heart:

  • refactor(groupbyable)!: simplify implementation and update typing info #207
  • Update all operation to prevent data loss #209
  • [PHPStan Baseline] Fix Errors Part 2 + Modify Unfold Operation #217

Contributors:

Merged

  • [PHPStan Baseline] Fix Errors Part 2 + Modify Unfold Operation #217
  • [PHPStan Baseline] Fix a few errors #216
  • Fix/update PHPStan #212
  • Fix All operation for standalone usage #215
  • Update all operation to prevent data loss #209
  • chore(deps): Bump actions/checkout from 2.3.5 to 2.4.0 #214
  • refactor(groupbyable)!: simplify implementation and update typing info #207
  • feat: Add Find operation #204
  • Refactor Current operation - Let specify a default value #205
  • chore(deps): Bump actions/checkout from 2.3.4 to 2.3.5 #203
  • fix: Update Flipable interface. #200
  • chore(deps): Bump shivammathur/setup-php from 2.14.0 to 2.15.0 #197

Commits

  • Fix ReadTheDocs builds - see readthedocs/readthedocs.org#8616 49d1673
  • refactor: Simplify MatchOne operation - Add missing typing informations. f66b407
  • refactor: Simplify MatchOne operation. 1e6ad7a
  • tests: Add SA tests for Random and Shuffle operations. cefe0f5
  • tests: Add SA tests for Wrap operation. ef61f57
5.1.0

Minor backward breaking changes

  • Associateoperation does not accept variadic arguments anymore
  • Inits operation returns arrays containing $key and $value, indexed by a numeric key.

Merged

  • Update various typing information #196
  • chore(deps): Bump shivammathur/setup-php from 2.13.0 to 2.14.0 #195
  • refactor: Fix PSalm issues. #194
  • Fix inits operation #191
  • refactor: Update Duplicate and Distinct operations in point free style. #188
  • refactor: Update various operation and typing informations #190
  • refactor: Update Init operation in point free style. #186
  • refactor: Update combine operation in point free style. #187
  • chore(deps): Bump shivammathur/setup-php from 2.12.0 to 2.13.0 #184
  • refactor: Update Transpose operation in point free style. #178
  • refactor: Update Zip operation in point free style. #181
  • refactor: Update Window operation in point free style. #179
  • fix: Update PHPStan configuration #183
  • refactor: Minor optimizations in various operations. #180
  • refactor: Update Collapse operation in point free style. #182
  • refactor: Update cross product operation in point free style. #177

Commits

  • fix: Update RandomIterator types. 5a5ae1d
  • fix: Fix Unpair operation return types. 885059f
  • fix: Autofix code style. 08199ca
  • Fix interfaces (to backport to master) f9b7c1c
  • Fix Rangeable interface (to backport to master) da430f9
  • Fix Zipable interface (to backport to master) 7e47439
  • Fix Initsable interface (to backport to master) 711f3c7
  • Fix Groupable interface (to backport to master) 6c24b7e
  • fix: Update return types of Implode and Unlines operation. 05bbf8e
  • refactor: Update Frequency operation return type and minor optimizations here and there. a1964f4
  • refactor: Update Transpose operation in point free style - add missing documentation (#178) bd0ec78
  • tests: Add missing test for the Window operation. a2ee653
5.0.0

On the 6 of August 2019, I started writing this library. Exactly 2 years later, version 5 is released.

85 releases have been created in 2 years. It's a lot. Writing this library was the best thing that happened to me in the last years, work-wise. I've learned so much! It opened for me doors to things I never had imagined before. I started to write this library to understand from A to Z the use of Iterators and Generators, to understand the concept of laziness, and to provide a framework-agnostic library in the PHP ecosystem.

Since May 2021, Alex Gidei joined the Loophp team to work on Collection; he improved the documentation, the static analysis and added a couple of new operations. The documentation is something important but it was inconsistent and incomplete - Alex rewrote dozens of operation documentation and provided many improvements along the way, especially in the examples files. Regarding the static analysis, we went from 1.5k analyzed expressions to 4.1k and we jumped from 94% to 97.1% score (Psalm level 2.). For each change, we discussed it together and it has always been an interesting and constructive discussion, even when sometimes we couldn't find an agreement and we had to close the pull request. Last but not least, he created a Principles documentation page which explains the principles in use in Collection, its DNA. Anyway, big thanks once again, Alex!

About version 5.0.0

This version breaks backward compatibility.

Backward breaking changes

New features:

* New operations:
  * Reject
  * isEmpty
  * Equals
  * Same
  * Reduce
* New static constructors:
    * fromGenerator

Updated operations:

* Filter
* Partition
* Span
* Map
* Contains
* Every
* Falsy
* Truthy
* Nullsy
* Match
* Has
* Reverse
* Column
* Pipe
* Unpack
* Distinct
* Duplicate            

What's next

Most probably taking a break!

Then, I wish I could add more typing everywhere. However, there is no way for Psalm or PHPStan to properly infer operations like Pipe. As a lot of operations are using Pipe, a lot of operations are not able to infer their types and we must add that information manually for each of them. The goal is to let the static analysis tools infer them properly automatically. Thus, to fix that, I created a temporary project to tackle the issue and create a Psalm plugin; you can find the work in progress here.

Merged

  • Documentation: Collection Principles #174
  • Refactor/update Span and Partition in point-free #175
  • refactor: UpdateDistinct and Duplicate operations. #168
  • refactor: Update Unpack operation - do not use MapN. #169
  • refactor: Use ETA Reduction for the Pipe operation. #164
  • refactor: Add missing type hints. #171
  • ci: Enable tests on macOS. #170
  • Update Reject operation - Use Filter based algorithm and point free style. #167
  • Fix Column Typing + SA Check #166
  • SA: Update operations. #165
  • Breaking change: refactor: Make constructor private. #163
  • Improve static analysis tests #153
  • chore(deps-dev): Update infection/infection requirement || ^0.24.0 #162
  • feat: Add ::fromGenerator constructor. #150
  • Temporary workaround until phpstan/phpstan#5372 is fixed. #161
  • Drop accepts non-variadic count #157
  • Add API Docs Description to Interface Methods #156
  • Add Operation: Same #155
  • Add Reduce operation #139
  • Add Equals Operation #152
  • Fix: Prevent warning when using odd amount of items. #154
  • Link to stable docs instead of latest #151
  • Update Span and Partition operations. #148
  • Breaking change: refactor: Reduce the use of the spread operators and variadic parameters. #146
  • refactor: Rename variables and properties. #145
  • chore(deps): Bump actions/stale from 3.0.19 to 4 #143
  • chore(deps): Bump shivammathur/setup-php from 2.11.0 to 2.12.0 #144
  • Add AsyncMapN Operation | Remove AsyncMap Variadic Callbacks Usage #141
  • Add coverage check #142
  • Span: Add Variadic Callback Support #140
  • Update Reverse operation - optimize and remove todos. #138
  • Add IsEmpty Operation #137
  • Update Operations Signatures in API Docs #136
  • Add All Operation #133
  • Refactor Scalar Operations #132
  • Update Map to only take a single callback #134
  • Provide util class for reducer callback #131
  • Refactor ::partition() and ::span() #124
  • Add Collection::isEmpty Method #130
  • Change GitHub Actions Workflow Triggers #127
  • Add Reject operation. #125
  • Breaking change: Update Filter operation. #126

Commits

  • chore: Add AFUP presentation link. 404d0b7
  • chore: Update Github configuration files. c6488a4
  • Update IfThenElse operation, add missing typing information. 5f4ef9e
  • Update IfThenElse operation, add missing typing information. ed3c095
  • ci: Fix code-style workflow. 40cc177
  • chore: Update composer.json, remove obsolete dependencies. d8a8d50
4.1.0

Thanks again @AlexandruGG for the hard work! This is the best release ever :boom: !

Merged

  • Show Collection is Immutable & Operations Pure #122
  • Trim Static Analysis Baselines #121
  • Adding More Static Analysis Checks #120
  • feat: Add Matching operation and implements Selectable from Doctrine. #115
  • Add FlatMap Operation #117
  • Update Distinct operation #111
  • Static Analysis Checks: Common Operations (III) #114
  • Introduce MapN | Deprecate Map With Multiple Callbacks | Static Analysis Checks #112
  • Bump minimum version of phpspec to ^7.1. #113
  • Static Analysis Checks: Common Operations (II) #109
  • Operation Interfaces return Collection Interface #108
  • Static Analysis Checks: Common Operations (I) #106
  • feat: Add When operation. #105
  • Improve Collection Typings + Add strict Operation #102
  • PHP 8 Compatibility #104
  • Update Psalm Annotations #101
  • chore(deps): Bump actions/cache from 2.1.5 to 2.1.6 #100
  • SA Checks: Methods Starting with "a" #97

Commits

  • chore: Update .gitattributes for saving space (and trees). c7ba932
  • docs: Minor update in code typing. c8ad466
  • Update PSalm and PHPStan baselines. 58d8035
  • Add missing Partitionable. defb903
  • Fixes & improvements 77201ba
  • test: Add missing test. 997efd9
  • refactor: Update distinct operation. 023d399
  • tests: Autofix code style. 366c79b
  • tests: Add missing static analysis tests. fb641e8
  • ci: Remove obsolete required status checks. 6a7f8c5
  • docs: Add a note on how to extend a Collection. 9d21114
  • ci: Run static-analysis tools only on Linux platform. fb9fcd7
  • ci: Do not do unit testing on Darwin platforms. 8921563
  • refactor: Fix PHPStan. 717b364
  • refactor: Fix Applyable type hints. cd8ef32
  • docs: Update example. 3f18553
4.0.7

Thanks @AlexandruGG for all your contributions! Keep them coming!

Merged

  • SA Checks: fromIterable, empty #96
  • SA Checks: fromCallable #94
  • docs: Add lazy JSON parsing examples using @halaxa JsonMachine library. #93
  • Introduce Static Analysis Checking System #90
  • Code Analysis Fixes - PHPStan #89
  • Update Documentation III #88
  • Update API Documentation II #86
  • chore(deps): Bump actions/stale from 3.0.18 to 3.0.19 #87
  • Feature: Add Squash operation #83
  • Fix CI configuration. #85
  • Update Documentation #84
  • chore(deps): Bump shivammathur/setup-php from 2 to 2.11.0 #79
  • chore(deps-dev): Update infection/infection requirement || ^0.23.0 #81
  • refactor: Remove static factory methods from contract #78
  • Update drupol/php-conventions #76

Commits

  • chore: Add composer commands and necessary files to generate the changelog. 645930e
  • ci: Update CI configuration. 3813450
  • refactor: Autofix code. 540006b
  • chore: Update drupol/php-conventions. cd50573
4.0.6

Commits

  • fix: Fix Psalm annotations. 4ace8ef
4.0.5

Commits

  • docs: Update changelog. 4516aef
  • ci: Update Docker stack - now includes service for creating changelogs. 228831e
  • refactor: Remove variable assignation. afe71bf
  • refactor: Update Pipe operation - remove call_user_func. d31df6f
  • feat: Add Coalesce operation. 6e5c758
  • refactor: Improve Has operation. 1425343
4.0.4

Merged

  • chore(deps): Bump actions/cache from v2.1.4 to v2.1.5 #75

Commits

  • docs: Update README.md. 4fa857b
  • chore: Update composer.json - update dev dependencies constraints. dbf6441
  • refactor: Fix a couple of PSalm issues. 89db061
  • refactor: Minor update on MatchOne operation. b913a6b
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calliostro/spotify-bundle
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle