Download the PHP package chris-kruining/utilities without Composer
On this page you can find all versions of the php package chris-kruining/utilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chris-kruining/utilities
More information about chris-kruining/utilities
Files in chris-kruining/utilities
Package utilities
Short Description Utilities for PHP 7.1 and up
License GPL-3.0-or-later
Homepage https://github.com/chris-kruining/utilities
Informations about the package utilities
Utilities
some utilities for php, nothing special, nothing new, just to my taste
Installation
installation is simply done via composer
composer require chris-kruining/utilities
Usage
The main component of the library is the Collection at the moment. The goal of the Collection is to provide a object oriented interface for array functions. It also has a couple of extra's like method chaining and linq-esc implementation(NOT DONE YET) so that you may interact with the Collection as if it was a database table
for example
would yield
which is the same as
I agree, the vannilla way is shorter now but the strength really comes into play when we start adding callbacks and increase the chain length
would yield
which is the same as
As you can see the collection version maintains readability whereas the vannilla version loses in my opinion it's charm because to achieve a single goal you need to spread it out over multiple variables
Roadmap
- [X] Implement basic features to
Collection - [X] Bloat
Collectionwith features :P - [X] Split of features into an inheritance tree
- [X] Split lazy mode from
CollectionintoLazyCollectionand implement PHP's array functions as generators - [ ] Finish inheritance structure
- [ ] Implement
LazyCollection - [X] (Better) implement the
Queryableinterface in a new class so theCollectiondoesn't become bloated
All versions of utilities with dependencies
psr/container Version ^1 || 2.0.2
nesbot/carbon Version 2.56.0
composer/composer Version 2.2.6
