Skip to content

fix(docs): add @throws to PHPDoc when appropriate#360

Merged
gjtorikian merged 1 commit intomainfrom
add-throws-phpdoc
Apr 14, 2026
Merged

fix(docs): add @throws to PHPDoc when appropriate#360
gjtorikian merged 1 commit intomainfrom
add-throws-phpdoc

Conversation

@gjtorikian
Copy link
Copy Markdown
Contributor

@gjtorikian gjtorikian commented Apr 14, 2026

Should close #356. The oagen-emitters have been modified to provide this information.

@gjtorikian gjtorikian requested review from a team as code owners April 14, 2026 19:48
@gjtorikian gjtorikian merged commit ed68872 into main Apr 14, 2026
9 checks passed
@gjtorikian gjtorikian deleted the add-throws-phpdoc branch April 14, 2026 19:52
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 14, 2026

Greptile Summary

This PR adds @throws annotations to the PHPDoc of all service methods across 17 service files, addressing issue #356. The changes are documentation-only and accurate: methods making HTTP calls are annotated with @throws \WorkOS\Exception\WorkOSException, URL-builder methods that call requireClientId() use the more specific @throws \WorkOS\Exception\ConfigurationException, and getLogoutUrl methods (which call only buildUrl() without requiring config) correctly receive no @throws tag.

Confidence Score: 5/5

Safe to merge — documentation-only change with accurate @throws annotations throughout.

All @throws annotations are accurate and consistent with the actual exception hierarchy. WorkOSException is an interface implemented by all throwable types; ConfigurationException is used precisely for URL-builder methods that call requireClientId(); methods that only call buildUrl() correctly have no annotation. No logic changes are present.

No files require special attention.

Important Files Changed

Filename Overview
lib/Service/UserManagement.php Large file with many auth methods; getAuthorizationUrl correctly uses @throws ConfigurationException, getLogoutUrl correctly has no @throws; all HTTP-request methods annotated with @throws WorkOSException.
lib/Service/Authorization.php Largest service file with 35+ methods; all HTTP-request methods now have @throws WorkOSException, consistent and correct.
lib/Service/SSO.php getAuthorizationUrl annotated with @throws ConfigurationException (calls requireClientId()), getLogoutUrl intentionally has no @throws (only calls buildUrl()); both are correct.
lib/Service/Connect.php All HTTP-request methods correctly annotated with @throws WorkOSException.
.oagen-manifest.json Manifest timestamp updated to reflect regeneration; no substantive changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Service Method] --> B{Makes HTTP request?}
    B -- Yes --> C["@throws WorkOSException"]
    B -- No --> D{Calls requireClientId or requireApiKey?}
    D -- Yes --> E["@throws ConfigurationException"]
    D -- No --> F[No @throws needed e.g. getLogoutUrl]
Loading

Reviews (1): Last reviewed commit: "fix(docs): add `@throws` to PHPDoc when ..." | Re-trigger Greptile

@VincentLanglet
Copy link
Copy Markdown
Contributor

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Methods phpdoc are missing @throws tag

2 participants