1 | <?php |
||
5 | class ReaderDataset implements \Iterator |
||
6 | { |
||
7 | const DATASETBR_STATE_FILE = 'https://raw.githubusercontent.com/datasets-br/state-codes/master/data/br-state-codes.csv'; |
||
8 | |||
9 | private $states; |
||
10 | |||
11 | private $separator = ','; |
||
12 | private $enclosure = '"'; |
||
13 | private $escape = '\\'; |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $filepath; |
||
18 | |||
19 | public function __construct($filepath) |
||
29 | |||
30 | public function read() |
||
47 | |||
48 | /** |
||
49 | * @param $resource |
||
50 | * |
||
51 | * @return GenericState |
||
52 | */ |
||
53 | private function readLine($resource) |
||
59 | |||
60 | public function current() |
||
64 | |||
65 | public function next() |
||
69 | |||
70 | public function key() |
||
74 | |||
75 | public function valid() |
||
79 | |||
80 | public function rewind() |
||
84 | } |
||
85 |