nozavroni / csvelte

🕺🏻 CSV and Tabular Data library for PHP
http://phpcsv.com/
Other
6 stars 0 forks source link

New Collection methods #165

Closed nozavroni closed 6 years ago

nozavroni commented 7 years ago

Add methods found in Doctrine collections and others. For instance:

// iterate over everything that meets given criteria
// could be called all, each, forEach, or forAll
// optionally may pass in an object to bind to (to give callback 
$coll->each(function($elem, $key, $iter){ return true }, $newThis);
// iterate until (iterates until it hits a true)
$coll->until($callback)

// opposite (iterates while callback returns true, first time it hits a false, stop)
$coll->while($callback)
nozavroni commented 6 years ago

collections are in their own repo now