Skip to content

Releases: loophp/collection

6.0.0

11 Nov 20:04
a55e97a
Compare
Choose a tag to compare

Features 💥

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

Breaking changes 💔

  • 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

5.1.0

27 Sep 16:19
Compare
Choose a tag to compare

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

06 Aug 11:57
Compare
Choose a tag to compare

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

05 Jul 16:09
Compare
Choose a tag to compare

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

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

25 May 08:40
Compare
Choose a tag to compare

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

20 Apr 15:36
Compare
Choose a tag to compare

Commits

  • fix: Fix Psalm annotations. 4ace8ef

4.0.5

20 Apr 15:28
Compare
Choose a tag to compare

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

17 Apr 20:20
Compare
Choose a tag to compare

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

4.0.3

11 Apr 20:52
Compare
Choose a tag to compare

Commits

  • refactor: Update MatchOne operation. 287b158
  • tests: Add more tests. 372b1d1
  • refactor: Update Every operation. e0cc29c

4.0.2

04 Apr 17:07
Compare
Choose a tag to compare

Commits

  • Revert "refactor: Use call_user_func_array() functions." 54327af