summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.editorconfig12
-rw-r--r--.gitattributes28
-rw-r--r--.travis.yml18
-rw-r--r--ISSUE_TEMPLATE.md22
-rw-r--r--composer.json6
-rw-r--r--src/Config/Output.php2
-rw-r--r--src/Modifier/QueryFilter.php6
7 files changed, 68 insertions, 26 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..56f3b6b
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,12 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.gitattributes b/.gitattributes
index e431d7a..89d7ee8 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,12 +1,16 @@
-/.gitattributes export-ignore
-/.gitignore export-ignore
-/.php_cs export-ignore
-/.travis.yml export-ignore
-/examples export-ignore
-/phpunit.xml export-ignore
-/README.md export-ignore
-/scrutinizer.yml export-ignore
-/test export-ignore
-/CHANGELOG.md export-ignore
-/CONTRIBUTING.md export-ignore
-/CONDUCT.md export-ignore
+* text=auto
+
+/.editorconfig export-ignore
+/.gitattributes export-ignore
+/.gitignore export-ignore
+/.php_cs export-ignore
+/.travis.yml export-ignore
+/examples export-ignore
+/phpunit.xml export-ignore
+/README.md export-ignore
+/scrutinizer.yml export-ignore
+/test export-ignore
+/CHANGELOG.md export-ignore
+/CONTRIBUTING.md export-ignore
+/CONDUCT.md export-ignore
+/ISSUE_TEMPLATE.md export-ignore
diff --git a/.travis.yml b/.travis.yml
index 57a217e..4e15ede 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,26 +5,28 @@ sudo: false
matrix:
include:
- php: 5.5
- env: COLLECT_COVERAGE=true
+ env: COLLECT_COVERAGE=true VALIDATE_CODING_STYLE=false
- php: 5.6
- env: COLLECT_COVERAGE=true
+ env: COLLECT_COVERAGE=true VALIDATE_CODING_STYLE=true
- php: 7.0
- env: COLLECT_COVERAGE=true
+ env: COLLECT_COVERAGE=true VALIDATE_CODING_STYLE=false
- php: hhvm
+ env: COLLECT_COVERAGE=false VALIDATE_CODING_STYLE=false
+ fast_finish: true
cache:
directories:
- $HOME/.composer/cache
before_install:
- - composer self-update
- - composer validate
+ - travis_retry composer self-update
install:
- - travis_retry composer install --prefer-dist
+ - travis_retry composer update --no-interaction --prefer-source
script:
- - composer test
+ - composer phpunit
after_script:
- - if [ "$COLLECT_COVERAGE" == "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
+ - if [ "$COLLECT_COVERAGE" == "true" ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/clover.xml; fi
+ - if [ "$VALIDATE_CODING_STYLE" == "true" ]; then composer phpcs fi \ No newline at end of file
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..a49d3aa
--- /dev/null
+++ b/ISSUE_TEMPLATE.md
@@ -0,0 +1,22 @@
+## Issue summary
+
+_(Please explain in plain english your issue/feature request)_
+
+### System informations
+
+_(In case of a bug report Please complete the table below)_
+
+| Information | Description |
+|--------------|---------|
+| League\Csv version | |
+| PHP/HHVM version | |
+| OS Platform | |
+
+
+## Standalone code, or other way to reproduce the problem
+
+_(Please complete the text below to help us fix the issue)_
+
+### Expected result
+
+### Actual result
diff --git a/composer.json b/composer.json
index 5da207e..b13f590 100644
--- a/composer.json
+++ b/composer.json
@@ -23,7 +23,7 @@
},
"require-dev": {
"phpunit/phpunit" : "^4.0",
- "fabpot/php-cs-fixer": "^1.9"
+ "friendsofphp/php-cs-fixer": "^1.9"
},
"autoload": {
"psr-4": {
@@ -37,7 +37,9 @@
}
},
"scripts": {
- "test": "phpunit --coverage-text; php-cs-fixer fix -v --diff --dry-run;"
+ "test": "phpunit --coverage-text; php-cs-fixer fix -v --diff --dry-run;",
+ "phpunit": "phpunit --coverage-text",
+ "phpcs": "php-cs-fixer fix -v --diff --dry-run;"
},
"extra": {
"branch-alias": {
diff --git a/src/Config/Output.php b/src/Config/Output.php
index e275e9b..27221d6 100644
--- a/src/Config/Output.php
+++ b/src/Config/Output.php
@@ -103,7 +103,7 @@ trait Output
*/
public function getEncodingFrom()
{
- return $this->input_encoding;
+ return $this->getInputEncoding();
}
/**
diff --git a/src/Modifier/QueryFilter.php b/src/Modifier/QueryFilter.php
index a9be156..2dad9bd 100644
--- a/src/Modifier/QueryFilter.php
+++ b/src/Modifier/QueryFilter.php
@@ -12,7 +12,7 @@
*/
namespace League\Csv\Modifier;
-use ArrayObject;
+use ArrayIterator;
use CallbackFilterIterator;
use Iterator;
use LimitIterator;
@@ -263,7 +263,7 @@ trait QueryFilter
return $iterator;
}
- $obj = new ArrayObject(iterator_to_array($iterator));
+ $obj = new ArrayIterator(iterator_to_array($iterator));
$obj->uasort(function ($row_a, $row_b) {
$res = 0;
foreach ($this->iterator_sort_by as $compare) {
@@ -276,7 +276,7 @@ trait QueryFilter
});
$this->iterator_sort_by = [];
- return $obj->getIterator();
+ return $obj;
}
/**