-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathBaseDataStream.php
More file actions
34 lines (29 loc) · 921 Bytes
/
BaseDataStream.php
File metadata and controls
34 lines (29 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace frictionlessdata\datapackage\DataStreams;
/**
* Provides a standard interface for streaming from a data stream (Read-only).
*
* functionality could mostly be replaced by php generators (http://php.net/manual/en/language.generators.syntax.php)
* however, they are only supported on PHP 5.5 and above
*/
abstract class BaseDataStream implements \Iterator
{
public $dataSource;
public $dataSourceOptions;
/**
* @param $dataSource
* @param mixed $dataSourceOptions
*/
public function __construct($dataSource, $dataSourceOptions = null)
{
$this->dataSource = $dataSource;
$this->dataSourceOptions = $dataSourceOptions;
}
abstract public function save($filename);
/**
* @return mixed
*
* @throws \frictionlessdata\datapackage\Exceptions\DataStreamValidationException
*/
abstract public function current():mixed;
}