Releases: loophp/collection
Releases · loophp/collection
7.4.0
Version 11 (6ea3c47)
v11-6ea3c47 docs: update changelog
7.3.0
Merged
- fix:
pair
andchunk
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
Commits
- fix: remove unused parameter bind
b2ef168
- fix: remove unused parameter bind
df8d3e9
- refactor: improve SA tests
81b1195
- fix: Updated PSalm baseline
4374455
- fix: Updated PSalm baseline
80c7a12
- fix:
Entropy
operation138fc0e
- cs: autofix coding standards
7be4f29
- cs: autofix coding standards
46db7b8
- docs: fix builds
c1acfbb
- docs: update RTD config
9bdd856
- autofix code style
9b4cf93
- autofix code style
1101f3a
- refactor: update
sort
operationcc26a56
7.2.1
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
7.1.1
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
operation50d416a
- chore: bump vimeo/psalm temporarily
1aca436
- fix: autofix code style
29b0456
- fix:
unfold
static operationsa429c78
- chore: remove obsolete PHPDoc annotations
531249e
- chore: update PHPStan baseline
999c257
- fix:
foldRight
operationf717078
- fix:
groupBy
update typing informationb55fec7
- chore: update
groupBy
b5662f4
- sa: update PHPStan
baseline
61f6367
- fix:
Matching
operation, add inline SA annotationse9cc0f3
- chore: update license date
755f8b3
- fix: update
empty
constructor9a4b0bb
- fix:
foldleft
,reduce
, update return types and tests19907fc
- fix:
foldleft
operationc3a536b
- cs: autofix code style
507175d
- fix:
last
operation improvements7c60e2c
- fix:
tails
SA improvement8e3de94
- fix:
tails
operation improvements58c840b
- fix:
compare
minor improvement5e46af0
- fix:
reduce
operation static annotations5c7d401
- fix: convert
callable
intoClosure
f30c87a
- fix:
reduce
operation, useReduceIterableIterator
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 example0c1d439
- ci: fix PDF documentation generation
c93f350
7.0.0
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 inloophp/collection
in their own project, and that project contains now many Iterator aggregates now in use inloophp/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 asfinal
. 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. - 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 usingIteratorAggregate
fromloophp/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 inloophp/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 usingunfold
, 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
TheScanLeft1
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. - #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.
TheTails
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 🔢
- 233 commits
- 18 issues closed
- No user contribution #SadPandaFace
- ~81k downloads in total (~200 per day) (https://packagist.org/packages/loophp/collection/stats)
Random 👍
- [Advent Of Code 2022][aoc website]
This year I decided to participate to the Advent Of Code and guess what... I'm usingloophp/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
withiterable
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
- usingIteratorAggregate
.#229
- Use
loophp/iterators
#228
Fixed
- tests: Add new tests.
#264