Skip to content

Require a GuzzleHttp\ClientInterface instead of any PSR-18 client (Psr\Http\Client\ClientInterface) - #19

Merged
pavog merged 1 commit into
mainfrom
guzzle-client-interface
Oct 16, 2026
Merged

pavog merged 1 commit into
mainfrom
guzzle-client-interface

Conversation

@pavog

@pavog pavog commented Oct 16, 2026

Copy link
Copy Markdown
Member

SpigotAPIClient accepted any PSR-18 client (Psr\Http\Client\ClientInterface), but the generated DefaultApi requires a Guzzle client (GuzzleHttp\ClientInterface).
Passing a PSR-18 client that is not a Guzzle client therefore always failed with a TypeError inside the generated code.

Aternos\SpigotApi\Api\DefaultApi::__construct(): 
Argument #1 ($client) must be of type ?GuzzleHttp\ClientInterface

The constructor and setHttpClient() now require GuzzleHttp\ClientInterface, so the error is reported where the client is passed in. Guzzle clients work exactly as before, and the README already uses a Guzzle client in its example.

@pavog
pavog merged commit dbd24fb into main Oct 16, 2026
5 checks passed
@pavog
pavog deleted the guzzle-client-interface branch October 16, 2026 13:41
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.

1 participant