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

Refactor due to the enshittification of guzzle #22

Closed
mradcliffe opened this issue Jun 12, 2024 · 1 comment · Fixed by #23
Closed

Refactor due to the enshittification of guzzle #22

mradcliffe opened this issue Jun 12, 2024 · 1 comment · Fixed by #23

Comments

@mradcliffe
Copy link
Owner

mradcliffe commented Jun 12, 2024

Issue Metadata
Type task
Version main

Problem/Motivation

Guzzle made the Client class (and most of its things) final, which means that a once useful way to extend a class is now useless for no reason. This could help remove the use of guzzle later on.

Proposed Resolution

  • Adds a client property to XeroClient.
  • Add public function XeroClientInterface::request(string $method, string|UriInterface $uri = '', array $options = []): ResponseInterface. This should create a Psr\Http\Message\RequestInterface instance probably from one of the from methods on Psr\Util or whatever.
    • Add a deprecated public function XeroClient::get(string|UriInterface $uri = '', array $options = []) because I mentioned get in the README. Maybe also a post and a put because those are used in Xero API.
  • Add public static function XeroClientInterface::createWithConfig(array $config, array $options) that returns a XeroClient instance.
  • Makes backwards-incompatible change to __construct method to only provide guzzle client.
  • Updates to documentation

Additional Information

N/A

@mradcliffe
Copy link
Owner Author

Of course nothing works with Guzzle 7.

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 a pull request may close this issue.

1 participant