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

Deprecation Warning Thrown on PHP8.2 #84

Open
jakewrfoster opened this issue Nov 22, 2023 · 2 comments
Open

Deprecation Warning Thrown on PHP8.2 #84

jakewrfoster opened this issue Nov 22, 2023 · 2 comments

Comments

@jakewrfoster
Copy link

jakewrfoster commented Nov 22, 2023

Issue

On PHP 8.2, the plugin throws the following deprecation warnings:

PHP Deprecated: Creation of dynamic property Media_Explorer::$file is deprecated in /my-cool-path/wp-content/plugins/media-explorer/class.plugin.php on line 27
PHP Deprecated:  Creation of dynamic property Media_Explorer::$plugin is deprecated in /my-cool-path/wp-content/plugins/media-explorer/class.plugin.php on line 89

Proposed solution

Add the props to the class so that they aren't dynamically created.

@jakewrfoster
Copy link
Author

I am unable to push a branch to PR this, but some variation of the following could be added here to address the issue

/**
 * The plugin's file path.
 *
 * @var string
 */
public string $file;

@jakewrfoster
Copy link
Author

and...

/**
 * The plugin's configuration.
 *
 * @var array
 */
public array $plugin;

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

No branches or pull requests

1 participant