woohoolabs / yang

The efficient and elegant, PSR-7 compliant JSON:API 1.1 client library for PHP
MIT License
168 stars 13 forks source link

Adopt PSR-18 #32

Closed holtkamp closed 1 year ago

holtkamp commented 3 years ago

Http\Client\HttpClient is deprecated, use of PSR-18 using Psr\Http\Client\ClientInterface is preferred

Since https://github.com/woohoolabs/yang/blob/d0a085edeb9dd7b8ebaad7d9f5a3dbbc88f7149a/src/JsonApi/Client/JsonApiAsyncClient.php still depends on HTTPPlug, maybe this can be isolated in a separate package woohoolabs/yang-async?

This would allow a smooth migration to PSR-18

kocsismate commented 3 years ago

Thanks for bringing this issue up! To be honest, I forgot about that HTTPlug is still used.. So I agree we should get rid of it. That said, I already wanted to make a major release (so that PHP 7.4 is required), and your suggestions will go well with that.

sveriger commented 1 year ago

Hi @kocsismate . Thx for your work! I need this feature, too. And I m happy to see that you consider this in major version 3, which is currently beta-1. Do you know when you will provide this?

kocsismate commented 1 year ago

The PR is merged :) Thanks for your patience! At last, I opted for keeping HTTPlug for the async client, I guess that's not a big problem to still have this dependency.

Unfortunately, I completely missed the beta version, so I had to merge master to the 3.0 branch. Please have a look at the changes if you have time, and tell me if I should add anything there. Then I'll release beta 2, and not soon afterwards, the final version. :)

holtkamp commented 1 year ago

@kocsismate thanks for the effort! Nice to see that the maximum PHPStan level has been reached 😃

Looks good to me!

kocsismate commented 1 year ago

@holtkamp The only bigger unsolved "issue" is with array/iterable type hints. I was added them for hours just to get even more errors, so at last I stopped fixing them and ignored the error category in the config.

holtkamp commented 1 year ago

@kocsismate yeah, chasing higher levels of strictness in PHPStan can be a "rabbithole" that only gets deeper and deeper... 🐰

kocsismate commented 1 year ago

v3.0 is released, so I'm closing the issue :)