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

Fix php notice for php8.1+ about DateTime::setDate return type #131

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

geo0000
Copy link

@geo0000 geo0000 commented Jul 5, 2022

I'm using PHP 8.1.2 and PHP 8.1.7 versions with your great library.
I found a small issue:
Deprecated function: Return type of Seboettg\CiteProc\Rendering\Date\DateTime::setDate($year, $month, $day) should either be compatible with DateTime::setDate(int $year, int $month, int $day): DateTime, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 480 of /var/www/vendor/composer/ClassLoader.php).

To fix it and have compatibility with older PHP versions we just need to add 1 line to your overridden setDate function.

@seboettg seboettg merged commit 0de06e8 into seboettg:develop Aug 1, 2022
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.

2 participants