Giter Site home page Giter Site logo

Comments (4)

dbu avatar dbu commented on July 22, 2024 1

oh indeed, we should do that. it would be another line right after https://github.com/php-http/HttplugBundle/blob/1.x/src/Resources/config/services.xml#L50 (and we could mark the alias for HttpClient as deprecated.)

do you want to create a pull request for that?

from httplugbundle.

dbu avatar dbu commented on July 22, 2024

we want to keep using the adapters to still provide the HttpAsyncClient. the Httplug HttpClient extends the PSR ClientInterface, people should depend on that rather than the deprecated HttpClient interface.

if you find places where we can update the documentation or code to talk about the PSR ClientInterface, glad if you can point them out or even do a pull request to cleanup things.

from httplugbundle.

zerkms avatar zerkms commented on July 22, 2024

In that case - is it possible then to create a default alias for the Psr\Http\Client\ClientInterface

$ ./bin/console debug:container|grep httplug.client
  Http\Client\HttpClient                                                               alias for "httplug.client.default"                                                                 
  Http\Client\HttpClient $default                                                         alias for "httplug.client.default"                                                                 
  Psr\Http\Client\ClientInterface $default                                                alias for "httplug.client.default"                                                                 
  httplug.client                                                                       alias for "httplug.client.default"                                                                 
  httplug.client.default                                                               alias for "httplug.client.default"                                                                 
  httplug.client.default                                                                  Http\Client\Common\PluginClient                                                                 
  httplug.client.default.client                                                           Http\Client\HttpClient                                                                          
  httplug.client.default.plugin.base_uri                                                  Http\Client\Common\Plugin\BaseUriPlugin                                                         
  httplug.client.default.plugin.base_uri.base_uri                                         Psr\Http\Message\UriInterface              

That's what we have now: it's possible to type hint Http\Client\HttpClient but Psr\Http\Client\ClientInterface is not hinteable unless the name is changed to $default everywhere in the codebase.

from httplugbundle.

zerkms avatar zerkms commented on July 22, 2024

I totally will do tomorrow then :-)

from httplugbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.