keboola / php-csv

CSV reader/writer
MIT License
135 stars 35 forks source link

Updates for php 8.1 compatibility #49

Closed kleinmp closed 1 year ago

kleinmp commented 2 years ago

I'm getting this warning when running this code in php 8.1:

Deprecated function: Return type of Keboola\Csv\CsvReader::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 5 of /var/www/vendor/keboola/csv/src/CsvReader.php).

This PR sets the return types of CsvReader to match that of Iterator in order to get rid of these warnings.

https://www.php.net/manual/en/class.iterator.php

derrabus commented 1 year ago

Duplicate of #48