lmerotta-zz / phpokeapi

A PHP7.1 Wrapper for PokéAPI, with cache and lazy-loading
32 stars 17 forks source link

Add support of customised HTTP client #1

Closed maidmaid closed 5 years ago

maidmaid commented 6 years ago

Why not add the support for a customised HTTP client ? Currently, the client internally uses the curl extension into its sendRequest() method and we could add more flexibility by adding the support of a HttpClient interface brought by HTTPlug.

public function __construct(string $url = 'https://pokeapi.co/api/v2/', CacheInterface $cache = null, SerializerInterface $serializer = null, HttpClient $httpClient = null)
lmerotta-zz commented 6 years ago

Sure! If you submit a PR I'd be glad to review it 😄