for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sergiors\Functional;
/**
* @author Sérgio Rafael Siqueira <[email protected]>
*/
class Collection
{
private $ls;
* @param array $ls
public function __construct($ls)
$this->ls = $ls;
}
* @param \Closure $fn
*
* @return Collection
public function filter($fn)
return new self(filter($fn, $this->ls));
public function map($fn)
return new self(map($fn, $this->ls));
* @return mixed
public function reduce($fn)
return reduce($fn, $this->ls);