More tests, filtering iterator, cleanup

This commit is contained in:
2022-10-31 02:58:34 +01:00
parent d0956f851c
commit fd2767b642
14 changed files with 340 additions and 21 deletions

View File

@ -2,6 +2,8 @@
namespace NoccyLabs\Dataset;
use Iterator;
/**
* DatasetManager is the central class of noccylabs/dataset.
*
@ -36,11 +38,11 @@ class DatasetManager
* Directly return a reader for a specific dataset.
*
* @param string $identifier The dataset identifier
* @return ReaderInterface A reader for the data
* @return Iterator A reader for the data
* @throws InvalidDatasetException if the dataset can not be opened
* @throws UnknownDatasetException if the dataset does not exist
*/
public function openDataset(string $identifier): ReaderInterface
public function openDataset(string $identifier): Iterator
{
return $this->getDataset($identifier)->open();
}
@ -157,6 +159,11 @@ class DatasetManager
return null;
}
/**
* Register a dataset
*
*
*/
public function registerDataset(Dataset $dataset)
{
$id = $dataset->getIdentifier();