1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-24 15:52:40 +01:00

Drop question mark suffix from optional PHPDoc @param types

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.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15925

Differential Revision: https://we.phorge.it/D25798
This commit is contained in:
Andre Klapper 2024-08-22 11:58:48 +02:00
parent 0c9c94748b
commit 901f060771
2 changed files with 8 additions and 6 deletions

View file

@ -35,7 +35,7 @@ final class PhutilSocketChannel extends PhutilChannel {
*
* @param socket Socket (stream socket, not plain socket). If only one
* socket is provided, it is used for reading and writing.
* @param socket? Optional write socket.
* @param socket (optional) Write socket.
*
* @task construct
*/

View file

@ -27,11 +27,13 @@ final class TempFile extends Phobject {
/**
* Create a new temporary file.
*
* @param string? Filename hint. This is useful if you intend to edit the
* file with an interactive editor, so the user's editor shows
* "commit-message" instead of "p3810hf-1z9b89bas".
* @param string? Root directory to hold the file. If omitted, the system
* temporary directory (often "/tmp") will be used by default.
* @param string (optional) Filename hint. This is useful if you intend to
* edit the file with an interactive editor, so the user's
* editor shows "commit-message" instead of
* "p3810hf-1z9b89bas".
* @param string (optional) Root directory to hold the file. If omitted, the
* system temporary directory (often "/tmp") will be used by
* default.
* @task create
*/
public function __construct($filename = null, $root_directory = null) {