Skip to content

v8.1.0

Compare
Choose a tag to compare
@z4kn4fein z4kn4fein released this 28 Sep 13:59
· 11 commits to master since this release
d4937f5

Added

  • Ability to override the default Guzzle HTTP client with a custom one:

    • The user has to implement the \ConfigCat\Http\FetchClientInterface to give the SDK a custom \Psr\Http\Client\ClientInterface implementation.
      namespace ConfigCat\Http;
      
      interface FetchClientInterface
      {
          public function getClient(): \Psr\Http\Client\ClientInterface;
          public function createRequest(string $method, string $uri): \Psr\Http\Message\RequestInterface;
      }
    • There's a new \ConfigCat\ClientOptions::FETCH_CLIENT configuration option where the SDK accepts a custom \ConfigCat\Http\FetchClientInterface implementation. This option defaults to \ConfigCat\Http\GuzzleFetchClient.
    • The Guzzle specific \ConfigCat\ClientOptions::REQUEST_OPTIONS and \ConfigCat\ClientOptions::CUSTOM_HANDLER configuration options have been marked as deprecated. Options for Guzzle are available through the \ConfigCat\Http\GuzzleFetchClient::create() method:
      $client = new \ConfigCat\ConfigCatClient('<SDK-KEY>', [
           \ConfigCat\ClientOptions::FETCH_CLIENT => \ConfigCat\Http\GuzzleFetchClient::create([
               \GuzzleHttp\RequestOptions::CONNECT_TIMEOUT => 5,
           ]),
       ]);
    • The direct dependency to guzzlehttp/guzzle was not removed yet due to minor upgrade backward compatibility. It can be moved to suggest at the next major version bump.
  • php-cs-fixer linter and phpstan static analyzer to the CI workflow. The whole project was reformatted and analyzed, this is why this PR is bigger than usual.

Removed

  • Dependency to Monolog. It was replaced by a simple default logger that writes to error_log(). It's still replaceable with any psr/log implementation.