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

Revert #263, fixes jsonSerialize fatal error on php 7.4 or lower #266

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

menno-ll
Copy link
Member

@menno-ll menno-ll commented Nov 20, 2023

Issue link

https://level-level.slack.com/archives/C02RENN0T/p1700146322403449
https://app.asana.com/0/1194139319537345/1205063740343242/f

Description

Reverts PR #263 .
This is needed because now already changing the return type would cause a fatal in PHP 7.4 or lower.
Instead, PR #265 has been created to bypass the deprication notice in PHP 8.1+, till Clarkson Core will not support PHP versions below 8.

How Has This Been Tested?

I picked a project running php 7.4.
And updated clarkson core in this project.
Then i added the following line to functions.php: echo json_encode( post::get(1) );. This breaks with the error shown in screenshot.
Then I removed the mixed return type from the jsonSerialize function.
The error is now gone.

Screenshots (if appropriate):

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@NielsdeBlaauw NielsdeBlaauw merged commit f2ac2cf into master Nov 20, 2023
1 check passed
@menno-ll menno-ll deleted the revert_pr_263 branch November 20, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants