Skip to content

Fix missing return values, URL inconsistencies, and comparison operators#206

Open
JoshSalway wants to merge 1 commit into
laravel:3.xfrom
JoshSalway:fix/return-values-and-consistency
Open

Fix missing return values, URL inconsistencies, and comparison operators#206
JoshSalway wants to merge 1 commit into
laravel:3.xfrom
JoshSalway:fix/return-values-and-consistency

Conversation

@JoshSalway
Copy link
Copy Markdown

@JoshSalway JoshSalway commented Mar 17, 2026

Fixes #209

Summary

Fixes several bugs and inconsistencies across the SDK:

Missing return values

  • reconnectToServer(): Missing return keyword — extracted public_key but never returned it
  • installCertificate(): Returns void when $wait = true — now returns the Certificate instance
  • activateCertificate(): Same issue — now returns Certificate after waiting
  • restartWorker(): Returns void when $wait = true — now returns the Worker instance

URL style inconsistency

  • deploymentHistory(), deploymentHistoryDeployment(), deploymentHistoryOutput(): Used absolute paths (/api/v1/servers/...) while every other method uses relative paths (servers/...). Both resolve to the same final URL since the base URI already includes /api/v1/, but relative paths are used consistently everywhere else.

Other fixes

  • getSiteCommand(): Was wrapping a single command in transformCollection() returning an array — now returns a single SiteCommand instance
  • handleRequestError(): Standardised status code comparisons to use strict === consistently (422, 404, 400 used loose == while 403 already used ===)

Test plan

  • Verify reconnectToServer() now returns the public key string
  • Verify installCertificate() returns Certificate instance after waiting
  • Verify activateCertificate() returns Certificate instance after waiting
  • Verify restartWorker() returns Worker instance after waiting
  • Verify deployment history methods still resolve to the same URLs
  • Verify getSiteCommand() returns a single SiteCommand, not an array
  • Verify error handling still works with strict comparisons

🤖 Generated with Claude Code

…d getSiteCommand return type

- Add missing return in reconnectToServer() (fixes #1)
- Add missing return in installCertificate() when wait=true (fixes #2)
- Add missing return in activateCertificate() when wait=true (fixes #3)
- Add missing return in restartWorker() when wait=true (fixes #4)
- Remove /api/v1/ prefix from deployment history methods (fixes #5)
- Use strict === for all status code comparisons (fixes #6)
- Return single SiteCommand instead of collection in getSiteCommand() (fixes #7)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Missing return values, URL inconsistencies, and comparison operator issues

1 participant