diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..89ded63 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{js,json,vue,css,less,scss}] +indent_size = 2 + +[Makefile] +indent_style = tab diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd9f724..3f9b6df 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - php_version: ["7.4", "8.0", "8.1", "8.2", "8.3"] + php_version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"] runs-on: ubuntu-latest container: diff --git a/Subscriber/ValidateCSVHeadersSubscriber.php b/Subscriber/ValidateCSVHeadersSubscriber.php index b172b9b..d80d6d4 100644 --- a/Subscriber/ValidateCSVHeadersSubscriber.php +++ b/Subscriber/ValidateCSVHeadersSubscriber.php @@ -42,7 +42,7 @@ public function onValidateSource(ImportValidateEvent $event): void fseek($fh, 0); } - $headers = fgetcsv($fh, 0, $config['load']['format_options']['field_delimiter']); + $headers = fgetcsv($fh, 0, $config['load']['format_options']['field_delimiter'], '"', ''); fclose($fh); $expectedHeaders = array_keys($config['load']['fields']); diff --git a/Tests/Load/CsvLoaderTest.php b/Tests/Load/CsvLoaderTest.php index f810568..319cecd 100644 --- a/Tests/Load/CsvLoaderTest.php +++ b/Tests/Load/CsvLoaderTest.php @@ -290,7 +290,7 @@ private function createCsv(string $csvContent): array fseek($handle, 0); $data = []; - while ($row = fgetcsv($handle)) { + while ($row = fgetcsv($handle, null, ',', '"', '')) { $data[] = $row; } diff --git a/composer.json b/composer.json index 345d7e1..cbb708d 100644 --- a/composer.json +++ b/composer.json @@ -23,10 +23,10 @@ "monolog/monolog": "^2.0|^3.0", "neitanod/forceutf8": "^2.0.4", "psr/log": "^1.0|^2.0|^3.0", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/string": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0|^8.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0|^8.0", + "symfony/finder": "^5.4|^6.0|^7.0|^8.0", + "symfony/string": "^5.4|^6.0|^7.0|^8.0", "symfony/translation-contracts": "^1|^2|^3" }, "autoload": { @@ -59,7 +59,7 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.4", "phpunit/phpunit": "^9.6", - "symfony/phpunit-bridge": "^5.4|^6.0|^7.0" + "symfony/phpunit-bridge": "^5.4|^6.0|^7.0|^8.0" }, "scripts": { "analyse": "./vendor/bin/phpstan analyse --no-progress", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index cd509b7..b2deb46 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -15,4 +15,5 @@ parameters: message: '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::.+\(\)#' paths: - ImportConfiguration.php + reportUnmatchedIgnoredErrors: false # required for different versions of Symfony tmpDir: .phpstan.cache diff --git a/phpunit.xml.dist b/phpunit.xml.dist index fd7b1bd..bf53402 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,8 @@ + + + ./