PHP 7 related errors
-
pseudo visitorParticipant4 years, 10 months ago #7163
Hi there – we are seeing several PHP 7 related errors that we need cleaned up before migrating our environments.
I’ll copy the errors below but the formatting might break in this form.
Your immediate attention to this issue would be much appreciated as we have a deadline to meet for our migration
FILE: …s/Code/http://www./wp-content/plugins/wpsolr-pro/wpsolr/pro/extensions/geolocation/class-wpsolr-option-geolocation.php
———————————————————————————————————————————–
FOUND 1 ERROR AFFECTING 1 LINE
———————————————————————————————————————————–
305 | ERROR | Indirect access to variables, properties and methods will be evaluated strictly in left-to-right order since PHP
| | 7.0. Use curly braces to remove ambiguity.
———————————————————————————————————————————–FILE: …/wp-content/plugins/wpsolr-pro/wpsolr/pro/extensions/geolocation/class-wpsolr-option-geolocation.php
———————————————————————————————————-
FOUND 2 ERRORS AFFECTING 2 LINES
———————————————————————————————————-
252 | ERROR | Indirect access to variables, properties and methods will be evaluated strictly in
| | left-to-right order since PHP 7.0. Use curly braces to remove ambiguity.
307 | ERROR | Indirect access to variables, properties and methods will be evaluated strictly in
| | left-to-right order since PHP 7.0. Use curly braces to remove ambiguity.
———————————————————————————————————-FILE: …Projects/Code/http://www./wp-content/plugins/wpsolr-pro/wpsolr/core/vendor/ruflin/elastica/lib/Elastica/Query/Bool.php
———————————————————————————————————————————–
FOUND 1 ERROR AFFECTING 1 LINE
———————————————————————————————————————————–
16 | ERROR | ‘bool’ is a reserved keyword as of PHP version 7.0 and should not be used to name a class, interface or trait or as
| | part of a namespace (T_CLASS)
———————————————————————————————————————————–pseudo visitorParticipant4 years, 10 months ago #7165There’s errors are on PHP 7.2
wpsolrKeymaster4 years, 10 months ago #7166These are not errors. Just sniffer reports.
I cannot comply to all PHP sniffer audit tools. My only obligation as the plugin developer is to ensure that the plugin is actually tested. Which is done with 120 Selenium tests, on PHP 7.0
I will of course try to check this report and fix what I can. But you can notice that some errors/warnings come from external libraries.
Do you have an idea of the sniffer used for your report ?
pseudo visitorParticipant4 years, 10 months ago #7167Thanks, we appreciate that.
For reference we used the following libraries for testing:
https://github.com/PHPCompatibility/PHPCompatibility
https://wordpress.org/plugins/php-compatibility-checker/wpsolrKeymaster4 years, 10 months ago #7172Next version WPSOLR 21.0 will be the first one certified PHP 7.2.
The former errors were corrected either changing WPSOLR code, or updating libraries.
https://wordpress.org/plugins/php-compatibility-checker/ is now included in the continuous integration (using command wp-cli “wp phpcompat 7.2 –scan=active”).
You must be logged in to reply to this topic.