1

Closed

Allow objects that implement Traversable to be passed to LinqToObjects

description

All this needs is two tiny changes in LinqToObjects.php.
 
First, change the handles() function to this:
 
public static function handles($source) {
return is_array($source) || $source instanceof Traversable;
}
 
And second, change the in() function to this:
 
public function in($source) {
if($source instanceof Traversable) {
    $source = iterator_to_array($source);
}
 
$this->_data = $source;
return $this;
}
Closed Apr 9, 2010 at 2:42 PM by maartenba
Fixed in SVN

comments