v8.1.0
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 tosuggest
at the next major version bump.
- The user has to implement the
-
php-cs-fixer
linter andphpstan
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 anypsr/log
implementation.