Completed
Push — master ( fba866...b10a48 )
by Ori
03:03
created

NativeDataSource::isEof()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace frictionlessdata\tableschema\DataSources;
3
4
use frictionlessdata\tableschema\Exceptions\DataSourceException;
5
6
/**
7
 * the data source parameter provided to the constructor should be an array of values
8
 * those values are then returned on each iteration
9
 */
10
class NativeDataSource extends BaseDataSource
11
{
12
    /**
13
     * @return array
14
     * @throws DataSourceException
15
     */
16
    public function getNextLine()
17
    {
18
        return $this->dataSource[$this->curRowNum++];
19
    }
20
21
    /**
22
     * @return bool
23
     * @throws DataSourceException
24
     */
25
    public function isEof()
26
    {
27
        return ($this->curRowNum >= count($this->dataSource));
28
    }
29
30
    protected $curRowNum = 0;
31
}
32