Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add phpdoc examples tag #636

Merged
merged 4 commits into from
Jun 6, 2023
Merged

feat: add phpdoc examples tag #636

merged 4 commits into from
Jun 6, 2023

Conversation

bshaffer
Copy link
Contributor

@bshaffer bshaffer commented Jun 6, 2023

fixes #547

With phpDocumentor we could remove the prefixed samples/ by passing in --examplesdir=samples when we run phpdoc. However, I think including samples/ in the path is better, since it makes things less ambiguous for anyone looking at the code rather than the published docs.

@bshaffer bshaffer requested review from a team as code owners June 6, 2023 17:11
*
* @return PhpDoc
*/
public static function sample(string $sampleFile): PhpDoc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I used the name sample for the function since the method name example is already taken

@noahdietz noahdietz self-assigned this Jun 6, 2023
@@ -682,6 +684,9 @@ private function rpcMethod(MethodDetails $method): PhpClassMember
AST::method($method->methodName . 'Async'))(),
'.')
: null,
in_array($this->serviceDetails->migrationMode, [MigrationMode::MIGRATING, MigrationMode::NEW_SURFACE_ONLY])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL: Way better way for checking migrationMode 😆

src/Generation/GapicClientV2Generator.php Outdated Show resolved Hide resolved
@bshaffer bshaffer merged commit 500e006 into main Jun 6, 2023
@bshaffer bshaffer deleted the add-phpdoc-examples-tag branch June 6, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: add "@example" phpdoc to GAPIC RPC methods for new SnippetGen
2 participants