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

Resolve PHP Compatability Checker Warnings #358

Closed
AlexGStapleton opened this issue Jun 16, 2020 · 8 comments
Closed

Resolve PHP Compatability Checker Warnings #358

AlexGStapleton opened this issue Jun 16, 2020 · 8 comments
Assignees

Comments

@AlexGStapleton
Copy link
Member

AlexGStapleton commented Jun 16, 2020

PHP Compatibility Checker

FILE: /home1/EDITED/EDITED/wp-content/themes/vantage/inc/widgets.php
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 45 ERRORS AND 1 WARNING AFFECTING 31 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------
12 | WARNING | Function name "__construct" is discouraged; PHP has reserved all method names with a double underscore prefix for future use.
126 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
127 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
127 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
130 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
131 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
131 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
134 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
135 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
135 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
138 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
139 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
139 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
142 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
143 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
143 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
155 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
156 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
156 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
159 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
160 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
160 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
163 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
164 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
164 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
167 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
168 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
168 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
176 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
177 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
177 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
184 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
185 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
185 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
188 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
189 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
189 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
192 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
193 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
193 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
198 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
199 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
199 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
205 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
206 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
206 | ERROR | "$this" can no longer be used in a plain function or method since PHP 7.1.
-----------------------------------------------------------------------------------------------------------------------------------------------

@AlexGStapleton
Copy link
Member Author

@Misplon I've looked into this and I don't see a workable solution to this. The $this related errors are correct but the first line isn't correct - __construct is one of the special reserved methods it mentions. Regardless, I attempted a fix for the $this errors and ended up with the same number of errors and warnings but with a different message. This time it's:

 126 | ERROR   | Late static binding is not supported outside of class scope.
 127 | ERROR   | Late static binding is not supported outside of class scope.
etc.

Based on the new error and the __construct error, the plugin mustn't realize the code is in a class. I'm not too sure how we can really fix/avoid that. They maintain a whitelist so maybe the way forward is to submit a request for that? Worst comes to the worst and we are doing something wrong, they'll let us know.

@Misplon
Copy link
Member

Misplon commented Jun 17, 2020

If this is a false positive, I'm happy to close. Thanks for investigating.

@Misplon
Copy link
Member

Misplon commented Jun 17, 2020

Sure, if you have a moment, let's make a whitelist submission to help us and everyone out.

@AlexGStapleton
Copy link
Member Author

I had an idea about what may be causing this. I reached out to the user who reported this and will report back shortly.

@Misplon
Copy link
Member

Misplon commented Jun 18, 2020

Super, thanks.

@AlexGStapleton
Copy link
Member Author

Okay I've finished the test, no dice. I had thought it was getting tricked by there being mutiple classes in the one file and tried switching to just one and no dice. :(

I'll submit a whitelist request later today.

@Misplon
Copy link
Member

Misplon commented Jun 20, 2020

Super, thanks. Please, link the request here when it has been submitted. Once that's done, please, close this issue.

@AlexGStapleton
Copy link
Member Author

wpengine/phpcompat#275

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

No branches or pull requests

2 participants