elasticsearch-php icon indicating copy to clipboard operation
elasticsearch-php copied to clipboard

Change typehint for fromConfig in ClientBuilder

Open leonrenkema opened this issue 1 year ago • 0 comments

Hi,

I saw the issue (#1227) where an interface for the Client is added to support mocking in the unittest.

Maybe it is an idea to also let the ClientBuilder have the ClientInterface as returntype instead of Client.

https://github.com/elastic/elasticsearch-php/blob/9a734ac64798fe242d49a00d5f335c1cf45429c0/src/ClientBuilder.php#L158

Then it will be possible to Mock the ClientBuilder and let fromConfig return a mocked instance.

leonrenkema avatar Mar 03 '23 18:03 leonrenkema