Skip to content

Make handler parameter nullable in WpClient constructor (#1)#2

Open
jgalea wants to merge 1 commit into
developfrom
agent/wp-http-1
Open

Make handler parameter nullable in WpClient constructor (#1)#2
jgalea wants to merge 1 commit into
developfrom
agent/wp-http-1

Conversation

@jgalea
Copy link
Copy Markdown

@jgalea jgalea commented May 28, 2026

This PR makes the $handler parameter of WpClient::__construct nullable with a null default, allowing php-http/discovery's ClassDiscovery to instantiate WpClient without arguments.

When null is passed (or no argument is given), the constructor falls back to HandlerStack::createDefault(), which is the same default used by the existing WpClient::createDefault() factory method.

Closes #1

Allows php-http/discovery's ClassDiscovery to instantiate WpClient
without arguments. When null is passed, the constructor falls back to
HandlerStack::createDefault().

Closes #1
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.

Constructor parameter prevents usage with php-http/discovery

1 participant