Page MenuHomePhorge

Drop question mark suffix from optional PHPDoc @param types
ClosedPublic

Authored by aklapper on Aug 22 2024, 09:59.
Tags
None
Referenced Files
F4011754: D25797.1746626591.diff
Tue, May 6, 14:03
F3741515: D25797.1745766428.diff
Sat, Apr 26, 15:07
F3731217: D25797.1745737485.diff
Sat, Apr 26, 07:04
F3729351: D25797.1745729418.diff
Sat, Apr 26, 04:50
F3720284: D25797.1745707026.diff
Fri, Apr 25, 22:37
F3717103: D25797.1745694701.diff
Fri, Apr 25, 19:11
F3657552: D25797.1745451337.diff
Tue, Apr 22, 23:35
F3529833: D25797.1744868556.diff
Wed, Apr 16, 05:42

Details

Summary

The question mark in @param type? $foo Desc is a custom notation not consistently applied across the codebase and not necessarily obvious to the reader (because custom and not mentioned in https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md ).
Instead, explicitly state "optional" in the parameter description for clarity.

Closes T15925.

Test Plan

Run PHPStan, see no PHPDoc @param has invalid value (type? [...] style output anymore.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I confirm with my hand on my heart that I've consumed my eyes inspecting every single line to be absolutely sure that this PHPDoc probably has a better meaning and will not cause nuclear implosions.

Wojak depressed.png (473×635 px, 160 KB)

This revision is now accepted and ready to land.Sep 6 2024, 16:22

@valerio.bozzolan: Thank you! I know this is super boring work, but it allows PHPStan to show other type/class issues which are currently hidden due to PHPStan barking earlier about that non-standard question mark when parsing those lines. :-/