Skip to content

Commit 66c376b

Browse files
committed
Merge pull request #50 from cordoval/improvements
various improvements
2 parents 49b21ba + d9f8b33 commit 66c376b

File tree

12 files changed

+20
-26
lines changed

12 files changed

+20
-26
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.DS_Store
2-
/.idea
31
.phpmake
42
/vendor
53
/composer.phar

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Goodby CSV is fully unit-tested. The library is stable and ready to be used in l
4444

4545
Install composer in your project:
4646

47-
```
47+
```bash
4848
curl -s http://getcomposer.org/installer | php
4949
```
5050

@@ -60,7 +60,7 @@ Create a `composer.json` file in your project root:
6060

6161
Install via composer:
6262

63-
```
63+
```bash
6464
php composer.phar install
6565
```
6666

@@ -130,7 +130,7 @@ $lexer->parse('rough.csv', $interpreter);
130130

131131
user.csv:
132132

133-
```
133+
```csv
134134
1,alice,alice@example.com
135135
2,bob,bob@example.com
136136
3,carol,carol@eample.com
@@ -155,14 +155,13 @@ $interpreter->addObserver(function(array $columns) use ($pdo) {
155155
});
156156

157157
$lexer->parse('user.csv', $interpreter);
158-
159158
```
160159

161160
### Import from TSV(tab separated values) to array
162161

163162
temperature.tsv:
164163

165-
```
164+
```csv
166165
9 Tokyo
167166
27 Singapore
168167
-5 Seoul
@@ -303,7 +302,7 @@ We works under test driven development.
303302

304303
Checkout master source code from github:
305304

306-
```
305+
```bash
307306
hub clone goodby/csv
308307
```
309308

@@ -319,10 +318,10 @@ composer.phar install --dev
319318

320319
Run phpunit:
321320

322-
```
321+
```bash
323322
./vendor/bin/phpunit
324323
```
325324

326325
## Acknowledgement
327326

328-
editing...
327+
Credits are found within composer.json file.

src/Goodby/CSV/Export/Protocol/.gitkeep

Whitespace-only changes.

src/Goodby/CSV/Export/Standard/Exporter.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
use Goodby\CSV\Export\Protocol\ExporterInterface;
66
use Goodby\CSV\Export\Protocol\Exception\IOException;
7-
use Goodby\CSV\Export\Standard\ExporterConfig;
87
use Goodby\CSV\Export\Standard\Exception\StrictViolationException;
9-
use SplFileObject;
108

119
/**
1210
* Standard exporter class

src/Goodby/CSV/Export/Standard/ExporterConfig.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,13 @@ public function getFileMode()
197197

198198
/**
199199
* Set the column headers.
200-
* @param array $headers
200+
* @param array $columnHeaders
201201
* @return ExporterConfig
202202
*/
203203
public function setColumnHeaders(array $columnHeaders)
204204
{
205205
$this->columnHeaders = $columnHeaders;
206+
206207
return $this;
207208
}
208209

src/Goodby/CSV/Import/Protocol/Exception/CsvFileNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Goodby\CSV\Import\Protocol\Exception;
44

55
/**
6-
* throw if csv file not found
6+
* Throws if csv file not found
77
*/
88
class CsvFileNotFoundException extends \RuntimeException
99
{

src/Goodby/CSV/Import/Standard/Interpreter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
/**
1010
* standard interpreter
11-
*
1211
*/
1312
class Interpreter implements InterpreterInterface
1413
{

src/Goodby/CSV/Import/Tests/Protocol/InterpreterTest.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
/**
88
* unit test for Interface of the Interpreter
9-
*
109
*/
1110
class InterpreterTest extends \PHPUnit_Framework_TestCase
1211
{
@@ -17,8 +16,9 @@ public function testInterpreterInterface()
1716
$interpreter = $this->getMock('\Goodby\CSV\Import\Protocol\InterpreterInterface');
1817

1918
$interpreter->expects($this->once())
20-
->method('interpret')
21-
->with($this->identicalTo($line));
19+
->method('interpret')
20+
->with($this->identicalTo($line))
21+
;
2222

2323
$interpreter->interpret($line);
2424
}
@@ -31,8 +31,9 @@ public function testInterpreterInterfaceWillThrownInvalidLexicalException()
3131
$interpreter = $this->getMock('\Goodby\CSV\Import\Protocol\InterpreterInterface');
3232

3333
$interpreter->expects($this->once())
34-
->method('interpret')
35-
->will($this->throwException(new InvalidLexicalException()));
34+
->method('interpret')
35+
->will($this->throwException(new InvalidLexicalException()))
36+
;
3637

3738
$line = "INVALID LEXICAL";
3839

src/Goodby/CSV/Import/Tests/Protocol/LexerTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public function testCsvFileNotFound()
3232
$path = 'invalid_dummy.csv';
3333

3434
$lexer->shouldReceive('parse')
35-
->with($path, $interpreter)
36-
->andThrow('Goodby\CSV\Import\Protocol\Exception\CsvFileNotFoundException');
35+
->with($path, $interpreter)
36+
->andThrow('Goodby\CSV\Import\Protocol\Exception\CsvFileNotFoundException')
37+
;
3738

3839
$lexer->parse($path, $interpreter);
3940
}

src/Goodby/CSV/Import/Tests/Standard/Join/LexerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
use Goodby\CSV\Import\Standard\Interpreter;
88
use Goodby\CSV\Import\Standard\LexerConfig;
99

10-
use Goodby\CSV\Import\Tests\Standard\Join\CSVFiles;
11-
1210
class LexerTest extends \PHPUnit_Framework_TestCase
1311
{
1412
public function test_shift_jis_CSV()

0 commit comments

Comments
 (0)