From 402d7952547502e91f03e3a2b51c7a02a30fef65 Mon Sep 17 00:00:00 2001 From: Janez Urevc Date: Wed, 22 Jul 2026 14:09:57 +0200 Subject: [PATCH 1/2] Prepare 3.0.0: PHP ^8.2 and portphp/portphp ^2.0 Breaking major: drop PHP < 8.2 and portphp 1.x. Add Dependabot and UPGRADE-3.0.md. --- .github/dependabot.yml | 13 +++++++++++++ UPGRADE-3.0.md | 4 ++++ composer.json | 6 +++--- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 UPGRADE-3.0.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f7b8104 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 5 + - package-ecosystem: composer + directory: / + schedule: + interval: monthly + open-pull-requests-limit: 5 + versioning-strategy: widen diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md new file mode 100644 index 0000000..ff43082 --- /dev/null +++ b/UPGRADE-3.0.md @@ -0,0 +1,4 @@ +# Upgrade from 2.x to 3.0 + +- Minimum PHP is **8.2** (`^8.2`). +- Requires `portphp/portphp` **^2.0**. diff --git a/composer.json b/composer.json index 7719973..1f99543 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^8.2", - "portphp/portphp": "^1.6.0" + "portphp/portphp": "^2.0" }, "autoload": { "psr-4": { @@ -32,7 +32,7 @@ } }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.6" }, "autoload-dev": { "psr-4": { @@ -41,7 +41,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } } } From a902bd9623fb94f91dff9a3021fa842d2e011b1b Mon Sep 17 00:00:00 2001 From: Janez Urevc Date: Wed, 22 Jul 2026 14:21:35 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Fix=20compatibility=20with=20portphp=202.0?= =?UTF-8?q?=20/=20Symfony=207=E2=80=938=20APIs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CsvReaderFactory.php | 3 ++- src/CsvWriter.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CsvReaderFactory.php b/src/CsvReaderFactory.php index f985c30..abc56ca 100644 --- a/src/CsvReaderFactory.php +++ b/src/CsvReaderFactory.php @@ -2,6 +2,7 @@ namespace Port\Csv; +use Port\Reader; use Port\Reader\ReaderFactory; /** @@ -62,7 +63,7 @@ public function __construct( * * @return CsvReader */ - public function getReader(\SplFileObject $file) + public function getReader(\SplFileObject $file): Reader { $reader = new CsvReader($file, $this->delimiter, $this->enclosure, $this->escape); diff --git a/src/CsvWriter.php b/src/CsvWriter.php index 2766b69..fcdb8f5 100644 --- a/src/CsvWriter.php +++ b/src/CsvWriter.php @@ -53,7 +53,7 @@ public function __construct($delimiter = ',', $enclosure = '"', $stream = null, /** * {@inheritdoc} */ - public function prepare() + public function prepare(): void { if ($this->utf8Encoding) { fprintf($this->getStream(), chr(0xEF) . chr(0xBB) . chr(0xBF)); @@ -63,7 +63,7 @@ public function prepare() /** * {@inheritdoc} */ - public function writeItem(array $item) + public function writeItem(array $item): void { if ($this->prependHeaderRow && 1 == $this->row++) { $headers = array_keys($item);