From b302851369f0e1a85f2689155b4c889104f65411 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Mon, 31 Mar 2025 22:21:36 +0200 Subject: [PATCH] PHPDoc: Replace non-existing param type phid with string Summary: `phid` is not a valid type. See https://docs.phpdoc.org/guide/references/phpdoc/types.html. Thus set the param type to `string` and get a few less errors reported by PHPStan. Test Plan: Read docs; run static code analysis. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D25940 --- .../auth/engine/PhabricatorAuthSessionEngine.php | 2 +- .../drydock/storage/DrydockAuthorization.php | 6 +++--- src/applications/drydock/storage/DrydockSlotLock.php | 6 +++--- .../feed/PhabricatorFeedStoryPublisher.php | 4 ++-- src/applications/files/storage/PhabricatorFile.php | 6 +++--- .../harbormaster/storage/HarbormasterBuildable.php | 4 ++-- .../replyhandler/PhabricatorMailReplyHandler.php | 12 ++++++------ .../metamta/storage/PhabricatorMetaMTAMail.php | 4 ++-- src/applications/people/storage/PhabricatorUser.php | 6 +++--- .../phid/query/PhabricatorObjectQuery.php | 2 +- src/applications/phid/type/PhabricatorPHIDType.php | 4 ++-- src/applications/phid/utils.php | 4 ++-- .../editor/PhabricatorSubscriptionsEditor.php | 6 +++--- .../interface/PhabricatorSubscribableInterface.php | 2 +- .../editengine/PhabricatorEditEngine.php | 2 +- .../PhabricatorApplicationTransactionEditor.php | 2 +- .../edges/editor/PhabricatorEdgeEditor.php | 8 ++++---- .../edges/query/PhabricatorEdgeQuery.php | 6 +++--- .../PhabricatorCursorPagedPolicyAwareQuery.php | 4 ++-- .../query/policy/PhabricatorPolicyAwareQuery.php | 4 ++-- 20 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/applications/auth/engine/PhabricatorAuthSessionEngine.php b/src/applications/auth/engine/PhabricatorAuthSessionEngine.php index f1a9e2a070..32fc884ce9 100644 --- a/src/applications/auth/engine/PhabricatorAuthSessionEngine.php +++ b/src/applications/auth/engine/PhabricatorAuthSessionEngine.php @@ -252,7 +252,7 @@ final class PhabricatorAuthSessionEngine extends Phobject { * * @param string $session_type Session type constant (see * @{class:PhabricatorAuthSession}). - * @param phid|null $identity_phid Identity to establish a session for, + * @param string|null $identity_phid Identity to establish a session for, * usually a user PHID. With `null`, generates an * anonymous session. * @param bool $partial True to issue a partial session. diff --git a/src/applications/drydock/storage/DrydockAuthorization.php b/src/applications/drydock/storage/DrydockAuthorization.php index 71f8c36cf8..4e3d891310 100644 --- a/src/applications/drydock/storage/DrydockAuthorization.php +++ b/src/applications/drydock/storage/DrydockAuthorization.php @@ -104,9 +104,9 @@ final class DrydockAuthorization extends DrydockDAO * blueprint selector control an object. * * @param PhabricatorUser $viewer User applying the change. - * @param phid $object_phid Object PHID change is being applied to. - * @param list $old Old blueprint PHIDs. - * @param list $new New blueprint PHIDs. + * @param string $object_phid Object PHID change is being applied to. + * @param list $old Old blueprint PHIDs. + * @param list $new New blueprint PHIDs. * @return void */ public static function applyAuthorizationChanges( diff --git a/src/applications/drydock/storage/DrydockSlotLock.php b/src/applications/drydock/storage/DrydockSlotLock.php index 3ba5163342..cbc9112e3f 100644 --- a/src/applications/drydock/storage/DrydockSlotLock.php +++ b/src/applications/drydock/storage/DrydockSlotLock.php @@ -43,7 +43,7 @@ final class DrydockSlotLock extends DrydockDAO { /** * Load all locks held by a particular owner. * - * @param phid $owner_phid Owner PHID. + * @param string $owner_phid Owner PHID. * @return list All held locks. * @task info */ @@ -114,7 +114,7 @@ final class DrydockSlotLock extends DrydockDAO { * This method either acquires all the locks or throws an exception (usually * because one or more locks are held). * - * @param phid $owner_phid Lock owner PHID. + * @param string $owner_phid Lock owner PHID. * @param list $locks List of locks to acquire. * @return void * @task locks @@ -158,7 +158,7 @@ final class DrydockSlotLock extends DrydockDAO { /** * Release all locks held by an owner. * - * @param phid $owner_phid Lock owner PHID. + * @param string $owner_phid Lock owner PHID. * @return void * @task locks */ diff --git a/src/applications/feed/PhabricatorFeedStoryPublisher.php b/src/applications/feed/PhabricatorFeedStoryPublisher.php index 81c3dceef0..d87f1f3a40 100644 --- a/src/applications/feed/PhabricatorFeedStoryPublisher.php +++ b/src/applications/feed/PhabricatorFeedStoryPublisher.php @@ -214,8 +214,8 @@ final class PhabricatorFeedStoryPublisher extends Phobject { /** * Remove PHIDs who should not receive notifications from a subscriber list. * - * @param list $phids List of potential subscribers. - * @return list List of actual subscribers. + * @param list $phids List of PHIDs of potential subscribers. + * @return list List of PHIDs of actual subscribers. */ private function filterSubscribedPHIDs(array $phids) { $phids = $this->expandRecipients($phids); diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index 0c21849869..ce03655086 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -1471,7 +1471,7 @@ final class PhabricatorFile extends PhabricatorFileDAO * Write the policy edge between this file and some object. * This method is successful even if the file is already attached. * - * @param phid $phid Object PHID to attach to. + * @param string $phid Object PHID to attach to. * @return $this */ public function attachToObject($phid) { @@ -1485,8 +1485,8 @@ final class PhabricatorFile extends PhabricatorFileDAO * NOTE: Please avoid to use this static method directly. * Instead, use PhabricatorFile#attachToObject(phid). * - * @param phid $file_phid File PHID to attach from. - * @param phid $object_phid Object PHID to attach to. + * @param string $file_phid File PHID to attach from. + * @param string $object_phid Object PHID to attach to. * @return void */ public static function attachFileToObject($file_phid, $object_phid) { diff --git a/src/applications/harbormaster/storage/HarbormasterBuildable.php b/src/applications/harbormaster/storage/HarbormasterBuildable.php index 2d085ce523..e0976c4bd0 100644 --- a/src/applications/harbormaster/storage/HarbormasterBuildable.php +++ b/src/applications/harbormaster/storage/HarbormasterBuildable.php @@ -60,8 +60,8 @@ final class HarbormasterBuildable /** * Start builds for a given buildable. * - * @param phid $phid PHID of the object to build. - * @param phid $container_phid Container PHID for the buildable. + * @param string $phid PHID of the object to build. + * @param string $container_phid Container PHID for the buildable. * @param list $requests List of builds to perform. * @return void */ diff --git a/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php b/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php index 53941e94cf..b3d571ce28 100644 --- a/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php +++ b/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php @@ -199,8 +199,8 @@ abstract class PhabricatorMailReplyHandler extends Phobject { * Each target should be sent a separate email, and contains the information * required to generate it with appropriate permissions and configuration. * - * @param list $raw_to List of "To" PHIDs. - * @param list $raw_cc List of "CC" PHIDs. + * @param list $raw_to List of "To" PHIDs. + * @param list $raw_cc List of "CC" PHIDs. * @return list List of targets. */ final public function getMailTargets(array $raw_to, array $raw_cc) { @@ -274,8 +274,8 @@ abstract class PhabricatorMailReplyHandler extends Phobject { * This takes any compound recipients (like projects) and looks up all their * members. * - * @param list $to List of To PHIDs. - * @param list $cc List of CC PHIDs. + * @param list $to List of To PHIDs. + * @param list $cc List of CC PHIDs. * @return pair, list> Expanded PHID lists. */ private function expandRecipientPHIDs(array $to, array $cc) { @@ -332,8 +332,8 @@ abstract class PhabricatorMailReplyHandler extends Phobject { * * Invalid recipients are dropped from the results. * - * @param list $to List of To PHIDs. - * @param list $cc List of CC PHIDs. + * @param list $to List of To PHIDs. + * @param list $cc List of CC PHIDs. * @return pair Maps from PHIDs to users. */ private function loadRecipientUsers(array $to, array $cc) { diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php index f0dbe4c5a1..e9aa5d16e5 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -859,9 +859,9 @@ final class PhabricatorMetaMTAMail * For example, this will expand project PHIDs into a list of the project's * members. * - * @param list $phids List of recipient PHIDs, possibly including + * @param list $phids List of recipient PHIDs, possibly including * aggregate recipients. - * @return list Deaggregated list of mailable recipients. + * @return list Deaggregated list pf PHIDs of mailable recipients. */ public function expandRecipients(array $phids) { if ($this->recipientExpansionMap === null) { diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php index 5a4b0f01f7..190f6e4ad1 100644 --- a/src/applications/people/storage/PhabricatorUser.php +++ b/src/applications/people/storage/PhabricatorUser.php @@ -949,7 +949,7 @@ final class PhabricatorUser * Get a @{class:PhabricatorHandleList} which benefits from this viewer's * internal handle pool. * - * @param list $phids List of PHIDs to load. + * @param list $phids List of PHIDs to load. * @return PhabricatorHandleList Handle list object. * @task handle */ @@ -968,7 +968,7 @@ final class PhabricatorUser * * This benefits from the viewer's internal handle pool. * - * @param phid $phid PHID to render a handle for. + * @param string $phid PHID to render a handle for. * @return PHUIHandleView View of the handle. * @task handle */ @@ -982,7 +982,7 @@ final class PhabricatorUser * * This benefits from the viewer's internal handle pool. * - * @param list $phids List of PHIDs to render. + * @param list $phids List of PHIDs to render. * @return PHUIHandleListView View of the handles. * @task handle */ diff --git a/src/applications/phid/query/PhabricatorObjectQuery.php b/src/applications/phid/query/PhabricatorObjectQuery.php index f1dd1feb4d..fd3d23d7da 100644 --- a/src/applications/phid/query/PhabricatorObjectQuery.php +++ b/src/applications/phid/query/PhabricatorObjectQuery.php @@ -197,7 +197,7 @@ final class PhabricatorObjectQuery * a transaction are valid. * * @param PhabricatorUser $viewer Viewer. - * @param list $phids List of ostensibly valid PHIDs. + * @param list $phids List of ostensibly valid PHIDs. * @return list List of invalid or restricted PHIDs. */ public static function loadInvalidPHIDsForViewer( diff --git a/src/applications/phid/type/PhabricatorPHIDType.php b/src/applications/phid/type/PhabricatorPHIDType.php index fda09c00d8..270074ffd1 100644 --- a/src/applications/phid/type/PhabricatorPHIDType.php +++ b/src/applications/phid/type/PhabricatorPHIDType.php @@ -53,7 +53,7 @@ abstract class PhabricatorPHIDType extends Phobject { * @{method:loadObjects} instead. * * @param PhabricatorObjectQuery $query Query being executed. - * @param list $phids PHIDs to load. + * @param list $phids PHIDs to load. * @return PhabricatorPolicyAwareQuery Query object which loads the * specified PHIDs when executed. */ @@ -68,7 +68,7 @@ abstract class PhabricatorPHIDType extends Phobject { * loading to work. * * @param PhabricatorObjectQuery $query Query being executed. - * @param list $phids PHIDs to load. + * @param list $phids PHIDs to load. * @return list Corresponding objects. */ public function loadObjects( diff --git a/src/applications/phid/utils.php b/src/applications/phid/utils.php index eb14c57df9..76ae985fe6 100644 --- a/src/applications/phid/utils.php +++ b/src/applications/phid/utils.php @@ -4,7 +4,7 @@ * Look up the type of a PHID. Returns * PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN if it fails to look up the type * - * @param phid $phid Anything. + * @param string $phid A PHID of anything. * @return string A value from PhabricatorPHIDConstants (ideally) */ function phid_get_type($phid) { @@ -18,7 +18,7 @@ function phid_get_type($phid) { /** * Group a list of phids by type. * - * @param $phids Array of phids + * @param array $phids Array of PHIDs. * @return map of phid type => list of phids */ function phid_group_by_type($phids) { diff --git a/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php b/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php index 22e1105f3f..7f64e45d34 100644 --- a/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php +++ b/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php @@ -18,7 +18,7 @@ final class PhabricatorSubscriptionsEditor extends PhabricatorEditor { * (or been subscribed) to the object, and will be added even if they * had previously unsubscribed. * - * @param list $phids List of PHIDs to explicitly subscribe. + * @param list $phids List of PHIDs to explicitly subscribe. * @return $this */ public function subscribeExplicit(array $phids) { @@ -32,7 +32,7 @@ final class PhabricatorSubscriptionsEditor extends PhabricatorEditor { * implicitly subscribes them (e.g., adding a comment) but it will be * suppressed if they've previously unsubscribed from the object. * - * @param list $phids List of PHIDs to implicitly subscribe. + * @param list $phids List of PHIDs to implicitly subscribe. * @return $this */ public function subscribeImplicit(array $phids) { @@ -45,7 +45,7 @@ final class PhabricatorSubscriptionsEditor extends PhabricatorEditor { * Unsubscribe PHIDs and mark them as unsubscribed, so implicit subscriptions * will not resubscribe them. * - * @param list $phids List of PHIDs to unsubscribe. + * @param list $phids List of PHIDs to unsubscribe. * @return $this */ public function unsubscribe(array $phids) { diff --git a/src/applications/subscriptions/interface/PhabricatorSubscribableInterface.php b/src/applications/subscriptions/interface/PhabricatorSubscribableInterface.php index 6528774ee8..8f2662805f 100644 --- a/src/applications/subscriptions/interface/PhabricatorSubscribableInterface.php +++ b/src/applications/subscriptions/interface/PhabricatorSubscribableInterface.php @@ -8,7 +8,7 @@ interface PhabricatorSubscribableInterface { * irrevocably a subscriber). This will, e.g., cause the UI to render * "Automatically Subscribed" instead of "Subscribe". * - * @param PHID $phid PHID (presumably a user) to test for automatic + * @param string $phid PHID (presumably a user) to test for automatic * subscription. * @return bool True if the object/user is automatically subscribed. */ diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php index df939a756b..0b1118a7aa 100644 --- a/src/applications/transactions/editengine/PhabricatorEditEngine.php +++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php @@ -809,7 +809,7 @@ abstract class PhabricatorEditEngine /** * Load an object by PHID. * - * @param phid $phid Object PHID. + * @param string $phid Object PHID. * @param list $capabilities (optional) List of required capability * constants, or omit for defaults. * @return object|null Object, or null if no such object exists. diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index 9bc00823d8..1c143728b2 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -4761,7 +4761,7 @@ abstract class PhabricatorApplicationTransactionEditor * If the list of PHIDs include mutually exclusive projects, remove the * conflicting projects. * - * @param list $phids List of project PHIDs. + * @param list $phids List of project PHIDs. * @return list List with conflicts removed. */ private function applyProjectConflictRules(array $phids) { diff --git a/src/infrastructure/edges/editor/PhabricatorEdgeEditor.php b/src/infrastructure/edges/editor/PhabricatorEdgeEditor.php index 91bbc34680..3afac20e09 100644 --- a/src/infrastructure/edges/editor/PhabricatorEdgeEditor.php +++ b/src/infrastructure/edges/editor/PhabricatorEdgeEditor.php @@ -45,9 +45,9 @@ final class PhabricatorEdgeEditor extends Phobject { * - `inverse_data` Optional, data to write on the inverse edge. If not * provided, `data` will be written. * - * @param phid $src Source object PHID. + * @param string $src Source object PHID. * @param string $type Edge type constant. - * @param phid $dst Destination object PHID. + * @param string $dst Destination object PHID. * @param map $options (optional) Options map (see documentation). * @return $this * @@ -67,9 +67,9 @@ final class PhabricatorEdgeEditor extends Phobject { * will be ignored. Edges are added after edges are removed, so the effect of * a remove plus an add is to overwrite. * - * @param phid $src Source object PHID. + * @param string $src Source object PHID. * @param string $type Edge type constant. - * @param phid $dst Destination object PHID. + * @param string $dst Destination object PHID. * @return $this * * @task edit diff --git a/src/infrastructure/edges/query/PhabricatorEdgeQuery.php b/src/infrastructure/edges/query/PhabricatorEdgeQuery.php index 1656487a0f..db86ddf2dd 100644 --- a/src/infrastructure/edges/query/PhabricatorEdgeQuery.php +++ b/src/infrastructure/edges/query/PhabricatorEdgeQuery.php @@ -121,7 +121,7 @@ final class PhabricatorEdgeQuery extends PhabricatorQuery { * edge type. Equivalent to building a full query, but simplifies a common * use case. * - * @param phid $src_phid Source PHID. + * @param string $src_phid Source PHID. * @param string $edge_type Edge type constant. * @return list List of destination PHIDs. */ @@ -139,9 +139,9 @@ final class PhabricatorEdgeQuery extends PhabricatorQuery { * if the edge does not exist or does not have metadata. Builds * and immediately executes a full query. * - * @param phid $src_phid Source PHID. + * @param string $src_phid Source PHID. * @param string $edge_type Edge type constant. - * @param phid $dest_phid Destination PHID. + * @param string $dest_phid Destination PHID. * @return wild Edge annotation (or null). */ public static function loadSingleEdgeData($src_phid, $edge_type, $dest_phid) { diff --git a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php index 6663637b49..f20a29f19b 100644 --- a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php +++ b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php @@ -2589,7 +2589,7 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery * * @param string $edge_type Edge constant. * @param string $operator Constraint operator. - * @param list $phids List of PHIDs. + * @param list $phids List of PHIDs. * @return $this * @task edgelogic */ @@ -3095,7 +3095,7 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery * Queries are always constrained to include only results from spaces the * viewer has access to. * - * @param list $space_phids + * @param list $space_phids PHIDs of the spaces. * @task spaces */ public function withSpacePHIDs(array $space_phids) { diff --git a/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php index a48d64b1ae..f9a4df0308 100644 --- a/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php +++ b/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php @@ -506,7 +506,7 @@ abstract class PhabricatorPolicyAwareQuery extends PhabricatorOffsetPagedQuery { * searches both the current query's workspace and the workspaces of parent * queries. * - * @param list $phids List of PHIDs to retrieve. + * @param list $phids List of PHIDs to retrieve. * @return $this * @task workspace */ @@ -536,7 +536,7 @@ abstract class PhabricatorPolicyAwareQuery extends PhabricatorOffsetPagedQuery { * PHIDs which are "in flight" are actively being queried for. Using this * list can prevent infinite query loops by aborting queries which cycle. * - * @param list $phids List of PHIDs which are now in flight. + * @param list $phids List of PHIDs which are now in flight. * @return $this */ public function putPHIDsInFlight(array $phids) {