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" } } } 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);