Skip to content

Commit

Permalink
remove Bakame iterator2array implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Feb 14, 2014
1 parent 061a4d2 commit 837f729
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 73 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"ext-mbstring" : "*"
},
"autoload": {
"files": ["src/Bakame/Csv/Iterator/functions.php"],
"psr-0": {
"Bakame": ["src", "test"]
}
Expand Down
4 changes: 2 additions & 2 deletions src/Bakame/Csv/AbstractCsv.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,14 @@ public function jsonSerialize()
if ('UTF-8' != $this->encoding) {
$iterator = new MapIterator($iterator, function ($row) {
foreach ($row as &$value) {
$value = mb_convert_encoding($value, 'UTF-8', $this->encoding);
$value = mb_convert_encoding($value, 'UTF-8', $this->encoding);
}
unset($value);

return $row;
});
}

return \Bakame\Csv\Iterator\iterator2Array($iterator, false);
return iterator_to_array($iterator, false);
}
}
60 changes: 0 additions & 60 deletions src/Bakame/Csv/Iterator/functions.php

This file was deleted.

6 changes: 3 additions & 3 deletions src/Bakame/Csv/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function fetchAll(callable $callable = null)
{
$iterator = $this->query($callable);

return \Bakame\Csv\Iterator\iterator2Array($iterator, false);
return iterator_to_array($iterator, false);
}

/**
Expand Down Expand Up @@ -159,7 +159,7 @@ public function fetchAssoc(array $keys, callable $callable = null)
return self::combineArray($keys, $row);
});

return \Bakame\Csv\Iterator\iterator2Array($iterator, false);
return iterator_to_array($iterator, false);
}

/**
Expand Down Expand Up @@ -189,7 +189,7 @@ public function fetchCol($columnIndex, callable $callable = null)
return $row[$columnIndex];
});

return \Bakame\Csv\Iterator\iterator2Array($iterator, false);
return iterator_to_array($iterator, false);
}

/**
Expand Down
7 changes: 0 additions & 7 deletions test/Bakame/Csv/CsvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,4 @@ public static function getIso8859Csv()
{
return [[file_get_contents(__DIR__.'/data/prenoms.csv')]];
}

public function testIterator2Array()
{
$res = \Bakame\Csv\Iterator\iterator2Array($this->csv);
$res2 = \Bakame\Csv\Iterator\iterator2Array($this->csv, false);
$this->assertSame($res, $res2);
}
}

0 comments on commit 837f729

Please sign in to comment.