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
This commit is contained in:
Andre Klapper 2025-03-31 22:21:36 +02:00
parent abb0d6815a
commit b302851369
20 changed files with 47 additions and 47 deletions

View file

@ -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.

View file

@ -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<phid> $old Old blueprint PHIDs.
* @param list<phid> $new New blueprint PHIDs.
* @param string $object_phid Object PHID change is being applied to.
* @param list<string> $old Old blueprint PHIDs.
* @param list<string> $new New blueprint PHIDs.
* @return void
*/
public static function applyAuthorizationChanges(

View file

@ -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<DrydockSlotLock> 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<string> $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
*/

View file

@ -214,8 +214,8 @@ final class PhabricatorFeedStoryPublisher extends Phobject {
/**
* Remove PHIDs who should not receive notifications from a subscriber list.
*
* @param list<phid> $phids List of potential subscribers.
* @return list<phid> List of actual subscribers.
* @param list<string> $phids List of PHIDs of potential subscribers.
* @return list<string> List of PHIDs of actual subscribers.
*/
private function filterSubscribedPHIDs(array $phids) {
$phids = $this->expandRecipients($phids);

View file

@ -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) {

View file

@ -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<HarbormasterBuildRequest> $requests List of builds to perform.
* @return void
*/

View file

@ -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<phid> $raw_to List of "To" PHIDs.
* @param list<phid> $raw_cc List of "CC" PHIDs.
* @param list<string> $raw_to List of "To" PHIDs.
* @param list<string> $raw_cc List of "CC" PHIDs.
* @return list<PhabricatorMailTarget> 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<phid> $to List of To PHIDs.
* @param list<phid> $cc List of CC PHIDs.
* @param list<string> $to List of To PHIDs.
* @param list<string> $cc List of CC PHIDs.
* @return pair<list<phid>, list<phid>> 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<phid> $to List of To PHIDs.
* @param list<phid> $cc List of CC PHIDs.
* @param list<string> $to List of To PHIDs.
* @param list<string> $cc List of CC PHIDs.
* @return pair<wild, wild> Maps from PHIDs to users.
*/
private function loadRecipientUsers(array $to, array $cc) {

View file

@ -859,9 +859,9 @@ final class PhabricatorMetaMTAMail
* For example, this will expand project PHIDs into a list of the project's
* members.
*
* @param list<phid> $phids List of recipient PHIDs, possibly including
* @param list<string> $phids List of recipient PHIDs, possibly including
* aggregate recipients.
* @return list<phid> Deaggregated list of mailable recipients.
* @return list<string> Deaggregated list pf PHIDs of mailable recipients.
*/
public function expandRecipients(array $phids) {
if ($this->recipientExpansionMap === null) {

View file

@ -949,7 +949,7 @@ final class PhabricatorUser
* Get a @{class:PhabricatorHandleList} which benefits from this viewer's
* internal handle pool.
*
* @param list<phid> $phids List of PHIDs to load.
* @param list<string> $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<phid> $phids List of PHIDs to render.
* @param list<string> $phids List of PHIDs to render.
* @return PHUIHandleListView View of the handles.
* @task handle
*/

View file

@ -197,7 +197,7 @@ final class PhabricatorObjectQuery
* a transaction are valid.
*
* @param PhabricatorUser $viewer Viewer.
* @param list<phid> $phids List of ostensibly valid PHIDs.
* @param list<string> $phids List of ostensibly valid PHIDs.
* @return list<phid> List of invalid or restricted PHIDs.
*/
public static function loadInvalidPHIDsForViewer(

View file

@ -53,7 +53,7 @@ abstract class PhabricatorPHIDType extends Phobject {
* @{method:loadObjects} instead.
*
* @param PhabricatorObjectQuery $query Query being executed.
* @param list<phid> $phids PHIDs to load.
* @param list<string> $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<phid> $phids PHIDs to load.
* @param list<string> $phids PHIDs to load.
* @return list<wild> Corresponding objects.
*/
public function loadObjects(

View file

@ -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) {

View file

@ -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<phid> $phids List of PHIDs to explicitly subscribe.
* @param list<string> $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<phid> $phids List of PHIDs to implicitly subscribe.
* @param list<string> $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<phid> $phids List of PHIDs to unsubscribe.
* @param list<string> $phids List of PHIDs to unsubscribe.
* @return $this
*/
public function unsubscribe(array $phids) {

View file

@ -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.
*/

View file

@ -809,7 +809,7 @@ abstract class PhabricatorEditEngine
/**
* Load an object by PHID.
*
* @param phid $phid Object PHID.
* @param string $phid Object PHID.
* @param list<string> $capabilities (optional) List of required capability
* constants, or omit for defaults.
* @return object|null Object, or null if no such object exists.

View file

@ -4761,7 +4761,7 @@ abstract class PhabricatorApplicationTransactionEditor
* If the list of PHIDs include mutually exclusive projects, remove the
* conflicting projects.
*
* @param list<phid> $phids List of project PHIDs.
* @param list<string> $phids List of project PHIDs.
* @return list<phid> List with conflicts removed.
*/
private function applyProjectConflictRules(array $phids) {

View file

@ -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

View file

@ -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<phid> 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) {

View file

@ -2589,7 +2589,7 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery
*
* @param string $edge_type Edge constant.
* @param string $operator Constraint operator.
* @param list<phid> $phids List of PHIDs.
* @param list<string> $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<phid|null> $space_phids
* @param list<string|null> $space_phids PHIDs of the spaces.
* @task spaces
*/
public function withSpacePHIDs(array $space_phids) {

View file

@ -506,7 +506,7 @@ abstract class PhabricatorPolicyAwareQuery extends PhabricatorOffsetPagedQuery {
* searches both the current query's workspace and the workspaces of parent
* queries.
*
* @param list<phid> $phids List of PHIDs to retrieve.
* @param list<string> $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<phid> $phids List of PHIDs which are now in flight.
* @param list<string> $phids List of PHIDs which are now in flight.
* @return $this
*/
public function putPHIDsInFlight(array $phids) {