forked from goodby/csv
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from handcraftedinthealps/feature/upgrade-pr
Add some open pr from original repository to the fork
- Loading branch information
Showing
2 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,18 +173,18 @@ use Goodby\CSV\Import\Standard\Lexer; | |
use Goodby\CSV\Import\Standard\Interpreter; | ||
use Goodby\CSV\Import\Standard\LexerConfig; | ||
|
||
$temperature = array(); | ||
$temperature = []; | ||
|
||
$config = new LexerConfig(); | ||
$config->setDelimiter("\t"); | ||
$lexer = new Lexer($config); | ||
|
||
$interpreter = new Interpreter(); | ||
$interpreter->addObserver(function(array $row) use (&$temperature) { | ||
$temperature[] = array( | ||
$temperature[] = [ | ||
'temperature' => $row[0], | ||
'city' => $row[1], | ||
); | ||
]; | ||
}); | ||
|
||
$lexer->parse('temperature.tsv', $interpreter); | ||
|
@@ -201,11 +201,11 @@ use Goodby\CSV\Export\Standard\ExporterConfig; | |
$config = new ExporterConfig(); | ||
$exporter = new Exporter($config); | ||
|
||
$exporter->export('php://output', array( | ||
array('1', 'alice', '[email protected]'), | ||
array('2', 'bob', '[email protected]'), | ||
array('3', 'carol', '[email protected]'), | ||
)); | ||
$exporter->export('php://output', [ | ||
['1', 'alice', '[email protected]'], | ||
['2', 'bob', '[email protected]'], | ||
['3', 'carol', '[email protected]'], | ||
]); | ||
``` | ||
|
||
|
||
|
@@ -240,10 +240,10 @@ use Goodby\CSV\Export\Standard\ExporterConfig; | |
|
||
use Goodby\CSV\Export\Standard\Collection\CallbackCollection; | ||
|
||
$data = array(); | ||
$data[] = array('user', 'name1'); | ||
$data[] = array('user', 'name2'); | ||
$data[] = array('user', 'name3'); | ||
$data = []; | ||
$data[] = ['user', 'name1']; | ||
$data[] = ['user', 'name2']; | ||
$data[] = ['user', 'name3']; | ||
|
||
$collection = new CallbackCollection($data, function($row) { | ||
// apply custom format to the row | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters