wceu / contributor-orientation-tool

A WordPress plugin aiming to help new contributors decide which make team/s to contribute to or join at Contributor Day.
GNU General Public License v3.0
13 stars 9 forks source link

Plugin fatal errors under PHP 5.6 #58

Open ironprogrammer opened 2 years ago

ironprogrammer commented 2 years ago

Issue

The following fatal error occurs when the activated plugin's environment is switched to PHP 5.6, which as of this writing is still supported by WordPress.

Catchable fatal error: Argument 1 passed to WPCOTool\Plugin::__construct() must be an instance of WPCOTool\string, string given, called in .../contributor-orientation-tool/contributor-orientation-tool.php on line 32 and defined in .../contributor-orientation-tool/src/WPCOTool/Plugin.php on line 74

The error stems from use of the string scalar type declaration in class constructors, support for which was added in PHP 7.0.

I came across this issue after switching PHP versions to test a PHP-version-specific WordPress core patch.

PHP Support

I understand that the plugin is marked as requiring a minimum of PHP 7.0, however, the source of this fatal error may not be apparent to some users. Preventing the occurrence of the resultant white screen of death would be a preferable alternative 😂 ...at least until PHP 5.6 support is officially dropped.