Skip to content

Commit

Permalink
fix(docs): invalid self references for async methods (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Oct 2, 2023
1 parent cb862b7 commit 8fa9a47
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 68 deletions.
2 changes: 1 addition & 1 deletion src/Generation/GapicClientV2Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ private function rpcMethod(MethodDetails $method): PhpClassMember
? PhpDoc::text(
'The async variant is',
AST::staticCall( // use staticCall for PHP Doc :: syntax
ResolvedType::self(),
$this->ctx->type($this->serviceDetails->gapicClientType),
AST::method($method->methodName . 'Async'))(),
'.')
: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ public function __call($method, $args)
* the actual limits, refer to
* [Rate Limits](https://cloud.google.com/functions/quotas#rate_limits).
*
* The async variant is {@see self::callFunctionAsync()} .
* The async variant is
* {@see CloudFunctionsServiceGapicClient::callFunctionAsync()} .
*
* @example samples/V1/CloudFunctionsServiceClient/call_function.php
*
Expand Down Expand Up @@ -323,7 +324,8 @@ public function callFunction(CallFunctionRequest $request, array $callOptions =
* the specified project, the long running operation will return
* `ALREADY_EXISTS` error.
*
* The async variant is {@see self::createFunctionAsync()} .
* The async variant is
* {@see CloudFunctionsServiceGapicClient::createFunctionAsync()} .
*
* @example samples/V1/CloudFunctionsServiceClient/create_function.php
*
Expand Down Expand Up @@ -351,7 +353,8 @@ public function createFunction(CreateFunctionRequest $request, array $callOption
* given function is used by some trigger, the trigger will be updated to
* remove this function.
*
* The async variant is {@see self::deleteFunctionAsync()} .
* The async variant is
* {@see CloudFunctionsServiceGapicClient::deleteFunctionAsync()} .
*
* @example samples/V1/CloudFunctionsServiceClient/delete_function.php
*
Expand Down Expand Up @@ -381,7 +384,8 @@ public function deleteFunction(DeleteFunctionRequest $request, array $callOption
* For more information about the signed URL usage see:
* https://cloud.google.com/storage/docs/access-control/signed-urls
*
* The async variant is {@see self::generateDownloadUrlAsync()} .
* The async variant is
* {@see CloudFunctionsServiceGapicClient::generateDownloadUrlAsync()} .
*
* @example samples/V1/CloudFunctionsServiceClient/generate_download_url.php
*
Expand Down Expand Up @@ -431,7 +435,8 @@ public function generateDownloadUrl(GenerateDownloadUrlRequest $request, array $
*
* * `Authorization: Bearer YOUR_TOKEN`
*
* The async variant is {@see self::generateUploadUrlAsync()} .
* The async variant is
* {@see CloudFunctionsServiceGapicClient::generateUploadUrlAsync()} .
*
* @example samples/V1/CloudFunctionsServiceClient/generate_upload_url.php
*
Expand All @@ -457,7 +462,8 @@ public function generateUploadUrl(GenerateUploadUrlRequest $request, array $call
/**
* Returns a function with the given name from the requested project.
*
* The async variant is {@see self::getFunctionAsync()} .
* The async variant is {@see CloudFunctionsServiceGapicClient::getFunctionAsync()}
* .
*
* @example samples/V1/CloudFunctionsServiceClient/get_function.php
*
Expand Down Expand Up @@ -485,7 +491,8 @@ public function getFunction(GetFunctionRequest $request, array $callOptions = []
* Returns an empty policy if the function exists and does not have a policy
* set.
*
* The async variant is {@see self::getIamPolicyAsync()} .
* The async variant is
* {@see CloudFunctionsServiceGapicClient::getIamPolicyAsync()} .
*
* @example samples/V1/CloudFunctionsServiceClient/get_iam_policy.php
*
Expand All @@ -511,7 +518,8 @@ public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions =
/**
* Returns a list of functions that belong to the requested project.
*
* The async variant is {@see self::listFunctionsAsync()} .
* The async variant is
* {@see CloudFunctionsServiceGapicClient::listFunctionsAsync()} .
*
* @example samples/V1/CloudFunctionsServiceClient/list_functions.php
*
Expand All @@ -538,7 +546,8 @@ public function listFunctions(ListFunctionsRequest $request, array $callOptions
* Sets the IAM access control policy on the specified function.
* Replaces any existing policy.
*
* The async variant is {@see self::setIamPolicyAsync()} .
* The async variant is
* {@see CloudFunctionsServiceGapicClient::setIamPolicyAsync()} .
*
* @example samples/V1/CloudFunctionsServiceClient/set_iam_policy.php
*
Expand Down Expand Up @@ -567,7 +576,8 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions =
* If the function does not exist, this will return an empty set of
* permissions, not a NOT_FOUND error.
*
* The async variant is {@see self::testIamPermissionsAsync()} .
* The async variant is
* {@see CloudFunctionsServiceGapicClient::testIamPermissionsAsync()} .
*
* @example samples/V1/CloudFunctionsServiceClient/test_iam_permissions.php
*
Expand All @@ -593,7 +603,8 @@ public function testIamPermissions(TestIamPermissionsRequest $request, array $ca
/**
* Updates existing function.
*
* The async variant is {@see self::updateFunctionAsync()} .
* The async variant is
* {@see CloudFunctionsServiceGapicClient::updateFunctionAsync()} .
*
* @example samples/V1/CloudFunctionsServiceClient/update_function.php
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public function __call($method, $args)
* The returned operation is automatically deleted after a few hours, so there
* is no need to call DeleteOperation.
*
* The async variant is {@see self::createInstanceAsync()} .
* The async variant is {@see CloudRedisGapicClient::createInstanceAsync()} .
*
* @param CreateInstanceRequest $request A request to house fields associated with the call.
* @param array $callOptions {
Expand All @@ -334,7 +334,7 @@ public function createInstance(CreateInstanceRequest $request, array $callOption
* Deletes a specific Redis instance. Instance stops serving and data is
* deleted.
*
* The async variant is {@see self::deleteInstanceAsync()} .
* The async variant is {@see CloudRedisGapicClient::deleteInstanceAsync()} .
*
* @param DeleteInstanceRequest $request A request to house fields associated with the call.
* @param array $callOptions {
Expand Down Expand Up @@ -363,7 +363,7 @@ public function deleteInstance(DeleteInstanceRequest $request, array $callOption
* The returned operation is automatically deleted after a few hours, so
* there is no need to call DeleteOperation.
*
* The async variant is {@see self::exportInstanceAsync()} .
* The async variant is {@see CloudRedisGapicClient::exportInstanceAsync()} .
*
* @param ExportInstanceRequest $request A request to house fields associated with the call.
* @param array $callOptions {
Expand All @@ -388,7 +388,7 @@ public function exportInstance(ExportInstanceRequest $request, array $callOption
* Initiates a failover of the master node to current replica node for a
* specific STANDARD tier Cloud Memorystore for Redis instance.
*
* The async variant is {@see self::failoverInstanceAsync()} .
* The async variant is {@see CloudRedisGapicClient::failoverInstanceAsync()} .
*
* @param FailoverInstanceRequest $request A request to house fields associated with the call.
* @param array $callOptions {
Expand All @@ -412,7 +412,7 @@ public function failoverInstance(FailoverInstanceRequest $request, array $callOp
/**
* Gets the details of a specific Redis instance.
*
* The async variant is {@see self::getInstanceAsync()} .
* The async variant is {@see CloudRedisGapicClient::getInstanceAsync()} .
*
* @param GetInstanceRequest $request A request to house fields associated with the call.
* @param array $callOptions {
Expand Down Expand Up @@ -443,7 +443,7 @@ public function getInstance(GetInstanceRequest $request, array $callOptions = []
* The returned operation is automatically deleted after a few hours, so
* there is no need to call DeleteOperation.
*
* The async variant is {@see self::importInstanceAsync()} .
* The async variant is {@see CloudRedisGapicClient::importInstanceAsync()} .
*
* @param ImportInstanceRequest $request A request to house fields associated with the call.
* @param array $callOptions {
Expand Down Expand Up @@ -475,7 +475,7 @@ public function importInstance(ImportInstanceRequest $request, array $callOption
* If `location_id` is specified as `-` (wildcard), then all regions
* available to the project are queried, and the results are aggregated.
*
* The async variant is {@see self::listInstancesAsync()} .
* The async variant is {@see CloudRedisGapicClient::listInstancesAsync()} .
*
* @param ListInstancesRequest $request A request to house fields associated with the call.
* @param array $callOptions {
Expand Down Expand Up @@ -503,7 +503,7 @@ public function listInstances(ListInstancesRequest $request, array $callOptions
* in the response field. The returned operation is automatically deleted
* after a few hours, so there is no need to call DeleteOperation.
*
* The async variant is {@see self::updateInstanceAsync()} .
* The async variant is {@see CloudRedisGapicClient::updateInstanceAsync()} .
*
* @param UpdateInstanceRequest $request A request to house fields associated with the call.
* @param array $callOptions {
Expand All @@ -528,7 +528,7 @@ public function updateInstance(UpdateInstanceRequest $request, array $callOption
* Upgrades Redis instance to the newer Redis version specified in the
* request.
*
* The async variant is {@see self::upgradeInstanceAsync()} .
* The async variant is {@see CloudRedisGapicClient::upgradeInstanceAsync()} .
*
* @param UpgradeInstanceRequest $request A request to house fields associated with the call.
* @param array $callOptions {
Expand Down

0 comments on commit 8fa9a47

Please sign in to comment.