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

v4 API: Use Trait for Methods #96

Merged
merged 5 commits into from
Apr 16, 2024
Merged

Conversation

n7studios
Copy link
Contributor

@n7studios n7studios commented Apr 12, 2024

Summary

Creates a new trait called ConvertKit_API_Traits class, containing:

  • all non-authentication API methods, moved from ConvertKit_API,
  • abstract trait methods for authentication and request methods, which ensures classes implementing this trait adhere to to the same structure (i.e. our ConvertKit_API class).

This allows an API class implementation (whether this SDK's ConvertKit_API or our WordPress Libraries) to use the API methods with their own HTTP request libraries (Guzzle for this SDK; wp_remote_* methods for the WordPress Library).

Testing

Existing tests pass.

Checklist

@n7studios n7studios added this to the 2.0 milestone Apr 12, 2024
@n7studios n7studios self-assigned this Apr 12, 2024
@n7studios n7studios requested review from a team, noelherrick and corydhmiller and removed request for a team April 15, 2024 12:24
@n7studios n7studios marked this pull request as ready for review April 15, 2024 12:24
@n7studios n7studios merged commit d079068 into v4-api-oauth Apr 16, 2024
4 checks passed
@n7studios n7studios deleted the v4-api-methods-traits branch June 26, 2024 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants