Page MenuHomePhabricator

NoEmptyIfDefinedPlugin treats properties of classes with AllowDynamicProperties as always set
Closed, ResolvedPublicBUG REPORT

Description

What happens?:
While running some extensions with the new phan-config version 0.13.0 there was also the hint to replace empty() on properties of classes Parser or EditPage, both are marked with #[\AllowDynamicProperties] and the empty is used also for error suppression in that case.

It seems that the plugin (from T234237) running with php8.1 also treat this as "always set"

Examples reported by the plugin:

What should have happened instead?:
Better not reporting this issues

Or are these expected false positives?
I have no php7.4 installed to test if the issue gets reported there as well.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Change 967663 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/tools/phan@master] Fix NoEmptyIfDefined behaviour with dynamic properties

https://gerrit.wikimedia.org/r/967663

Change 967663 merged by jenkins-bot:

[mediawiki/tools/phan@master] Fix NoEmptyIfDefined behaviour with dynamic properties

https://gerrit.wikimedia.org/r/967663