Our standard collection class for handling lists in PHP. By lists, we mean numerically indexed arrays.
This package also contains our StandardIteratorInterface. We use this if we
are writing specific collection classes that hold only particular types of
objects.
Apache License (Version 2.0). Please see License File for more information.
File an issue, or ideally submit a pull request. Bug fixes should be submitted against the master branch,
new features/changes should be submitted against the develop branch. Pull requests should have updated or new
unit tests in them.
Make sure your IDE has an EditorConfig plugin installed.
Clone the repository, then:
composer up
vendor/bin/phpunitThe CloudCreativity\Utils\Collection\Collection is a standard class for
handling numerically indexed lists. It comes with the following methods.
The following methods modify the list contained within the collection:
addaddStrictaddObjectsclearfillfillObjectinsertAtpoppushpushObjectsremoveremoveAtremoveStrictreplaceshiftunshiftunshiftObjects
The following methods give access to items within the collection:
firstitemAtlast
The following methods can be used to assess or query the contents of the collection;
anycontainscontainsStrictequalsequalsStricteveryindexOfindexOfStrictisEmptyisNotEmptysearchsearchStrict
The following methods assist with handling the list, and return new instances of the collection. (I.e. the original collection is not modified.)
allcast(static)chunkcompactcopycountcreate(static)diffeachfilterimplodeintersectinvokeitemsAtmappadreducerejectreplicatereverseslicesortsynctaketapuniqueuniqueStrictwithoutwithoutStrict