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
F2963979: D25797.1739268841.diff
Mon, Feb 10, 10:14
F2943108: D25797.1738164973.diff
Tue, Jan 28, 15:36
F2938955: D25797.1738026825.diff
Mon, Jan 27, 01:13
F2938953: D25797.1738026823.diff
Mon, Jan 27, 01:13
F2938851: D25797.1738024794.diff
Mon, Jan 27, 00:39
F2932347: D25797.1737733246.diff
Thu, Jan 23, 15:40
F2889034: D25797.1737198429.diff
Jan 17 2025, 11:07
F2871129: D25797.1736838249.diff
Jan 13 2025, 07:04

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. :-/