php-docs-samples
php-docs-samples copied to clipboard
Pub/Sub: distinguish resource names and resource IDs
Samples should refer to the fully qualified topic paths projects/{}/topics/{} as topic names and the actual string for the topic as the topic id.
The same goes for subscriptions.
For example, this should be $topic = $pubsub->topic($topicId);.
https://github.com/GoogleCloudPlatform/php-docs-samples/blob/906d56f233954dfcaa47237d491851234608257c/pubsub/api/src/publish_message.php#L42
Hi @anguillanneuf I know this issue was filled a while ago, but can you mention why is it important to use the fully qualified names instead of the friendly names?
I think the user would be more comfortable in using the topicName instead of the topicId.
Moreover, when I checked this, there are other clients which seem to be using the topicName as well.