You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 80d2e42
Browse filesBrowse the repository at this point in the historyBrowse files
Code Quality: Resolve the varTag.noVariable PHPStan errors.
PHPStan reports `varTag.noVariable` for a `@var` tag that names no variable and is not above a local variable assignment, since such a tag has nothing to apply to. Eight of these were above `define()` calls, which declare no variable, and they are removed. No type information is lost, since PHPStan reads the types of the constants that vary by environment from `dynamicConstantNames` and infers the others from their values. The tag for `CUSTOM_TAGS` was also wrong, as it described the constant as an array of tags rather than a flag, so its docblock now explains that defining it as `true` uses the KSES globals in place of the defaults.
The other nine were above assignments to `WP_Query` properties, where they were added in r49700 to help IDEs narrow the union property types. Neither PHPStan nor !PhpStorm applied them, and PHPStan already narrows each property from the assigned value, so they are removed as well. Two similar tags above local variables in `WP_Query::get_posts()` are also removed, since they only overrode the types PHPStan infers, one of them with a less precise type. This empties the baseline, so it is removed.
Developed in #15449.
Follow-up to r49700, r49927, r63020.
Props mukesh27, westonruter.
See #66739.
git-svn-id: https://develop.svn.wordpress.org/trunk@65794 602fd350-edb4-49c9-b593-d223f7449a82
0 commit comments