Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility for PHP 8.1 #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexander-schranz
Copy link
Contributor

@alexander-schranz alexander-schranz commented Sep 5, 2021

Additonal parameter was added and fputcsv has a returntype of int|false now. For cross support php version support I added the #[ReturnTypeWillChange] attribute.

Example:

Errors:

php -r 'class CsvFileObject extends SplFileObject
{
public function fputcsv($fields, $delimiter = null, $enclosure = null, $escape = null, $eol = null){}
}'

PHP Deprecated: Return type of CsvFileObject::fputcsv($fields, $delimiter = null, $enclosure = null, $escape = null, $eol = null) should either be compatible with SplFileObject::fputcsv(array $fields, string $separator = ",", string $enclosure = """, string $escape = "\", string $eol = "\n"): int|false, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Command line code on line 3

Fix:

php -r 'class CsvFileObject extends SplFileObject
{
#[ReturnTypeWillChange]
public function fputcsv($fields, $delimiter = null, $enclosure = null, $escape = null, $eol = null){}
}'

@alexander-schranz alexander-schranz mentioned this pull request Sep 5, 2021
11 tasks
@alexander-schranz
Copy link
Contributor Author

Merged into fork: handcraftedinthealps#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant