Skip to content

Commit 57884d5

Browse files
authored
Merge pull request #22 from keboola/renovation
Renovation
2 parents 6f1d645 + e35a9ba commit 57884d5

32 files changed

+1062
-1069
lines changed

.codeclimate.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: "2"
2+
plugins:
3+
phpmd:
4+
enabled: true
5+
phpcodesniffer:
6+
enabled: true
7+
sonar-php:
8+
enabled: true
9+
checks:
10+
php:S1117:
11+
enabled: false

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
language: php
22
before_script: composer install
33
php:
4-
- 5.4
5-
- 5.5
6-
- 5.6
7-
- 7.0
8-
- hhvm
9-
4+
- 5.6
5+
- 7.0
6+
- hhvm
7+
notifications:
8+
slack:
9+
secure: WVnUU0fkZS75md3mm7B08SxhP3HDeHbJ8GTPR1DUVjK3MHAmKeSah/plNNxn9I/TdlXnHzQO5WBN33nUq0ODGGT4WFzFa66YTX2tb+bNSmewBOv82hEoITTI1PI9SLq0WNtcamHWCM3Rt1XtiZb3DQk/OcUfiWrrn74q4PPX+VY=

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
## 2.0.0
2+
* [Refactor] No support for PHP < 5.6
3+
4+
## 1.2.0
5+
* [Feat] Add option to skip lines (header) when reading
6+
7+
## 1.1.4
8+
* [Feat] Throw exception if non-scalar data is written
9+
110
## 1.1.3
2-
* [Bugfix] Throw exception on file write error
11+
* [Bugfix] Throw exception on file write error

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
[![Latest Stable Version](https://poser.pugx.org/keboola/csv/v/stable.svg)](https://packagist.org/packages/keboola/csv)
33
[![License](https://poser.pugx.org/keboola/csv/license.svg)](https://packagist.org/packages/keboola/csv)
44
[![Total Downloads](https://poser.pugx.org/keboola/csv/downloads.svg)](https://packagist.org/packages/keboola/csv)
5+
[![Maintainability](https://api.codeclimate.com/v1/badges/869a0ab5c1d228279ab0/maintainability)](https://codeclimate.com/github/keboola/php-csv/maintainability)
6+
[![Test Coverage](https://api.codeclimate.com/v1/badges/869a0ab5c1d228279ab0/test_coverage)](https://codeclimate.com/github/keboola/php-csv/test_coverage)
7+
8+
The library provides a simple reader and writer for CSV files according to [RFC4180](https://tools.ietf.org/html/rfc4180).
9+
The library is licensed under the [MIT](https://github.com/keboola/php-csv/blob/master/LICENSE) license. The library provides
10+
a single `CsvFile` class for both reading and writing CSV files. The class is designed to be **immutable** and minimalistic.
511

612
## Usage
713

@@ -14,6 +20,19 @@ foreach($csvFile as $row) {
1420
}
1521
```
1622

23+
#### Skip lines
24+
Skip the first two lines:
25+
26+
```php
27+
use Keboola\Csv\CsvFile;
28+
$filename = __DIR__ . '/_data/test-input.csv';
29+
$csvFile = new \Keboola\Csv\CsvFile($fileName, CsvFile::DEFAULT_DELIMITER, CsvFile::DEFAULT_ENCLOSURE, CsvFile::DEFAULT_ENCLOSURE, 2)
30+
foreach($csvFile as $row) {
31+
var_dump($row);
32+
}
33+
```
34+
35+
1736
### Write CSV
1837

1938
```php
@@ -34,31 +53,13 @@ foreach ($rows as $row) {
3453

3554
## Installation
3655

37-
Library is available as composer package.
38-
To start using composer in your project follow these steps:
39-
40-
**Install composer**
41-
42-
```bash
43-
curl -s http://getcomposer.org/installer | php
44-
mv ./composer.phar ~/bin/composer # or /usr/local/bin/composer
45-
```
46-
47-
**Create composer.json file in your project root folder:**
48-
49-
```json
50-
{
51-
"require": {
52-
"php" : ">=5.3.2",
53-
"keboola/csv": "1.1.*"
54-
}
55-
}
56-
```
56+
The library is available as [composer package](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).
57+
To start using this library in your project follow these steps:
5758

5859
**Install package:**
5960

6061
```bash
61-
composer install
62+
composer require keboola/csv
6263
```
6364

6465

bootstrap.php

Lines changed: 0 additions & 5 deletions
This file was deleted.

build.xml

Lines changed: 0 additions & 156 deletions
This file was deleted.

build/resources/coding-style/Keboola/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php

Lines changed: 0 additions & 56 deletions
This file was deleted.

build/resources/coding-style/Keboola/ruleset.xml

Lines changed: 0 additions & 39 deletions
This file was deleted.

build/resources/phpmd.xml

Lines changed: 0 additions & 25 deletions
This file was deleted.

build/results/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)