Skip to content

Commit

Permalink
laravel arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
dakujem committed Aug 21, 2024
1 parent 89871ec commit a2f30a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1036,19 +1036,19 @@ You might not need this library.
- `mpetrovich/dash` provides a full range of transformation functions, uses _arrays_ internally
- `lodash-php/lodash-php` imitates Lodash and provides a full range of utilities, uses _arrays_ internally
- `nikic/iter` implements a range of iteration primitives using _generators_, authored by a PHP core team member
- `illuminate/collections` should cover the needs of most Laravel developers, check the inner implementation for details
- `illuminate/collections` should cover the needs of most Laravel developers, but uses _arrays_ internally
- in many cases, a `foreach` will do the same job

This library (`dakujem/toru`) does not provide a full range of ready-made transformation functions,
Toru library (`dakujem/toru`) does not provide a full range of ready-made transformation functions,
rather provides the most common ones and means to bring in and compose own transformations.

It originally started as an alternative to `nikic/iter` for daily tasks, which to me has a somewhat cumbersome interface.
The `Itera` static _class_ tries to fix that
by using a single class import instead of multiple function imports
and by reordering the parameters so that the input collection is consistently the first one.
Still, composing multiple operations into one transformation is cumbersome, so the `IteraFn` factory was implemented to fix that.
It worked well, but was still verbose for mundane tasks.
To allow concise fluent/chained calls (like with Lodash), the `Dash` class was designed.
Still, composing multiple operations into one transformation felt cumbersome, so the `IteraFn` factory was implemented to fix that.
It worked well, but was still kind of verbose for mundane tasks.
To allow concise fluent/chained calls (like with Lodash), the `Dash` class was then designed.
With it, it's possible to compose transformations neatly.


Expand Down

0 comments on commit a2f30a2

Please sign in to comment.