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 8.2 deprecation warning #759

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DanieleAlessandra
Copy link
Collaborator

@DanieleAlessandra DanieleAlessandra commented Nov 11, 2024

The report on PHP 8.2 deprecation warnings for dynamic properties highlighted three cases, which this PR addresses:

  1. FS_Plugin_Plan::pricing – This was resolved in June.
  2. FS_Site::blog_id – This issue was due to direct assignment.
  3. FS_User::is_beta – This resulted from the use of unserialize.

Changes:

  • Removed the @property FS_Pricing[] $pricing annotation from FS_Plugin_Plan, as the property now exists and the annotation is no longer necessary.
  • Added the $blog_id property to FS_Site and removed the corresponding annotation, similar to the previous class.
  • Introduced the __wakeup magic method to FS_User to remove deprecated properties from serialized entities.
  • Added the __unserialize magic method to FS_User to manage the result of unserialize and prevent warnings. This method only works with public properties and can be removed if the __wakeup method is sufficient. __unserialize magic method is detected as non-magic in PHP 7.3 and older by phpcs.

…ion warning adding missing property to FS_Site class and using magic functions in FS_User class. FS_Plugin_Plan has been fixed in June.
@DanieleAlessandra DanieleAlessandra force-pushed the feature/daniele/fix-deprecation-warning-with-php8.2 branch from 2724729 to 452e982 Compare November 11, 2024 18:05
Version number
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