Completed
Branch master (7d7b3f)
by Ori
01:38
created

BaseDataStream   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
current() 0 1 ?
1
<?php
2
3
namespace frictionlessdata\datapackage\DataStreams;
4
5
/**
6
 * Provides a standard interface for streaming from a data stream (Read-only).
7
 *
8
 * functionality could mostly be replaced by php generators (http://php.net/manual/en/language.generators.syntax.php)
9
 * however, they are only supported on PHP 5.5 and above
10
 */
11
abstract class BaseDataStream implements \Iterator
12
{
13
    public $dataSource;
14
    public $dataSourceOptions;
15
16
    /**
17
     * @param string $dataSource
18
     * @param mixed  $dataSourceOptions
19
     *
20
     * @throws \frictionlessdata\datapackage\Exceptions\DataStreamOpenException
21
     */
22
    public function __construct($dataSource, $dataSourceOptions = null)
23
    {
24
        $this->dataSource = $dataSource;
25
        $this->dataSourceOptions = $dataSourceOptions;
26
    }
27
28
    /**
29
     * @return mixed
30
     *
31
     * @throws \frictionlessdata\datapackage\Exceptions\DataStreamValidationException
32
     */
33
    abstract public function current();
34
}
35