Opened 4 weeks ago
Last modified 4 weeks ago
#7749 new defect (bug)
Convert assignment statement in Parser class to make compatible to PHP 7.2
Reported by: | rabmalin | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Plugin Directory | Keywords: | close 2nd-opinion |
Cc: |
Description
We are using Readme Parser class in a plugin whose minimum supported PHP is 7.2.
In this class, following in the only statement which is not supported in PHP 7.2
I am creating this ticket requesting to rewrite following line of code to make it compatible to PHP 7.2
$this->warnings['contributor_ignored'] ??= [];
The null coalesce equal operator (??=) is not present in PHP version 7.3 or earlier (PHPCompatibility.Operators.NewOperators.t_coalesce_equalFound)
Change History (4)
#2
@
4 weeks ago
- Keywords close 2nd-opinion added
I think I'd prefer to keep it targeting PHP 7.4, and PHP 8.1 in the not-too-distant-future.
Being able to re-use the plugin readme code in the plugin-check plugin is useful, I admit though.
This ticket was mentioned in Slack in #meta by dd32. View the logs.
4 weeks ago
#4
@
4 weeks ago
I see the plugin readme parser as any other library with a requirement. If you want to use it unmodified, you may need to update the requirements of your project.
Also, like any other class you can extend it and write a modified version of the function for you needs. Yes, that is more work.
We don't need it to be compatible because we run PHP 7.4 on wordpress.org.