Skip to content

Commit

Permalink
fix(docs): misc reference fixes (#7613)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Aug 22, 2024
1 parent 0f04255 commit 81bed09
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
13 changes: 10 additions & 3 deletions .kokoro/docs/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ fi
if [ "$STAGING_BUCKET" != "" ]; then
echo "Using staging bucket ${STAGING_BUCKET}..."
fi
VERBOSITY="";
if [ "$GCLOUD_DEBUG" -eq 1 ]; then
echo "Setting verbosity to VERBOSE...";
VERBOSITY=" -v";
fi

find $PROJECT_DIR/* -mindepth 1 -maxdepth 1 -name 'composer.json' -not -path '*vendor/*' -regex "$PROJECT_DIR/[A-Z].*" -exec dirname {} \; | while read DIR
do
Expand All @@ -31,13 +36,15 @@ do
--component $COMPONENT \
--out $DIR/out \
--metadata-version $VERSION \
--staging-bucket $STAGING_BUCKET
--staging-bucket $STAGING_BUCKET \
$VERBOSITY
else
# dry run
$PROJECT_DIR/dev/google-cloud docfx \
--component $COMPONENT \
--out $DIR/out \
--metadata-version $VERSION
--metadata-version $VERSION \
$VERBOSITY
fi
done

Expand Down Expand Up @@ -77,4 +84,4 @@ if [ "$KOKORO_GITHUB_COMMIT" != "" ]; then
composer update -d "$module"
cp "$module/composer.lock" "pkg/$module/composer.lock"
done
fi
fi
10 changes: 5 additions & 5 deletions Firestore/src/Admin/V1/FirestoreAdminClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/*
* GENERATED CODE WARNING
* Generated by gapic-generator-php from the file
* https://github.com/google/googleapis/blob/master/google/firestore/admin/v1/firestore_admin.proto
* https://github.com/googleapis/googleapis/blob/master/google/firestore/admin/v1/firestore_admin.proto
* Updates to the above are reflected here through a refresh process.
*/

Expand All @@ -31,7 +31,7 @@
class FirestoreAdminClient extends FirestoreAdminGapicClient
{
/**
* @see FirestoreAdminClient::createIndexLRO
* @see FirestoreAdminClient::createIndexLRO()
* @return \Google\LongRunning\Operation
* @deprecated use createIndexLRO instead
*/
Expand All @@ -41,7 +41,7 @@ public function createIndex($parent, $index, array $optionalArgs = [])
}

/**
* @see FirestoreAdminClient::exportDocumentsLRO
* @see FirestoreAdminClient::exportDocumentsLRO()
* @return \Google\LongRunning\Operation
* @deprecated use exportDocumentsLRO instead
*/
Expand All @@ -51,7 +51,7 @@ public function exportDocuments($name, array $optionalArgs = [])
}

/**
* @see FirestoreAdminClient::importDocumentsLRO
* @see FirestoreAdminClient::importDocumentsLRO()
* @return \Google\LongRunning\Operation
* @deprecated use importDocumentsLRO instead
*/
Expand All @@ -63,7 +63,7 @@ public function importDocuments($name, array $optionalArgs = [])
/**
* @return \Google\LongRunning\Operation
* @deprecated use updateFieldLRO instead
* @see FirestoreAdminClient::updateFieldLRO
* @see FirestoreAdminClient::updateFieldLRO()
*/
public function updateField($field, array $optionalArgs = [])
{
Expand Down
2 changes: 1 addition & 1 deletion Firestore/src/V1/FirestoreClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/*
* GENERATED CODE WARNING
* This file was generated from the file
* https://github.com/google/googleapis/blob/master/google/firestore/v1/firestore.proto
* https://github.com/googleapis/googleapis/blob/master/google/firestore/v1/firestore.proto
* and updates to that file get reflected here through a refresh process.
*
* @experimental
Expand Down
2 changes: 1 addition & 1 deletion PubSub/src/PubSubClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function createTopic($name, array $options = [])
* Lazily instantiate a topic with a topic name.
*
* No API requests are made by this method. If you want to create a new
* topic, use {@see Topic::createTopic()}.
* topic, use {@see Topic::create()}.
*
* Example:
* ```
Expand Down
3 changes: 2 additions & 1 deletion dev/src/DocFx/Node/ClassNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ public function isServiceBaseClass(): bool
public function isV2ServiceClass(): bool
{
// returns true if the class does not extend another class and isn't a
// base class
// base class and it contains a "Client" namespace
if (!$this->getExtends()
&& !$this->isServiceBaseClass()
&& 'Client' === substr($this->getName(), -6)
&& false !== strpos($this->getFullName(), '\\Client\\')
) {
return true;
}
Expand Down
9 changes: 6 additions & 3 deletions dev/src/DocFx/XrefValidationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private function getBrokenXrefs(string $description): array
{
$brokenRefs = [];
preg_replace_callback(
'/<xref uid="([^ ]*)"/',
'/<xref uid="([^ ]*)">([^ ]*)<\/xref>/',
function ($matches) use (&$brokenRefs) {
// Valid external reference
if (0 === strpos($matches[1], 'http')) {
Expand All @@ -78,21 +78,24 @@ function ($matches) use (&$brokenRefs) {
return;
}
// Valid class reference
if (class_exists($matches[1]) || interface_exists($matches[1] || trait_exists($matches[1]))) {
if (class_exists($matches[1]) || interface_exists($matches[1]) || trait_exists($matches[1])) {
return;
}
// Valid method, magic method, andd constant references

// Valid method, magic method, and constant references
if (false !== strpos($matches[1], '::')) {
if (false !== strpos($matches[1], '()')) {
list($class, $method) = explode('::', str_replace('()', '', $matches[1]));
// Valid method reference
if (method_exists($class, $method)) {
return;
}

// Assume it's a magic Async method
if ('Async' === substr($method, -5)) {
return;
}

} elseif (defined($matches[1])) {
// Valid constant reference
return;
Expand Down

0 comments on commit 81bed09

Please sign in to comment.