Releases: intercom/intercom-php
Remove unnecessary files from release
This release reduces the size of the sdk by excluding unnecessary files from the package (tests, test configurations, CI configuration, etc).
Enable autowiring for Symfony via type hinting
This is a minor patch that adds type hinting to constructors and some other methods for enhanced security and enhanced compatibility with the Symfony4 autowiring features. See #282 for more details.
None of the methods where type hinting was added would have worked if the incorrect types were passed through, so this change is fully backwards compatible.
Add customer search endpoint
This release enables the usage of the new customer search endpoint.
At the moment of writing, this is only available in the Unstable version. Please see the API Changelog and the notes about API Versions for intercom-php.
Enable compatibility with HTTPlug version 2
This release adds compatibility with php-http/client-common version 2, which also allows this library to be used with HTTPlug 2.
Fix incorrectly named variables in IntercomClient
#274 fixes two variables with incorrect names, which might lead to some warnings or errors, for example, if PHP strict mode is enabled.
Use ErrorPlugin to raise 4xx and 5xx exceptions
#272 After the previous upgrade we discovered that no errors were being thrown. To address this we used ErrorPlugin to raise 4xx and 5xx exceptions
[BREAKING CHANGE] Upgrading to 7.1 and using HTTPlug
-
Upgrade to PHP 7.1+ #271
PHP 5.6 and 7.0 are no longer supported. We should only support active versions (7.1, 7.2 and 7.3 at the time of writing) -
Abstract the HTTP client using HTTPPlug #270
This version introduces HTTPPlug as the HTTP Client. HTTPPlug allows this library to use any HTTP Library as long as there is a HTTPPlug adaptor for it. All major libraries are available (Guzzle5/6, CURL, Buzz and many more).
Upgrade instructions:
- Check if any change from the list below affects your code and update it if required.
- Choose a client implementation and include it to your dependencies (ie
composer require php-http/curl-client). We recommend that you choose the adapter for the library you already use in your project. If you don't use any,php-http/curl-clientis the most lightweight.- Upgrade your
intercom/intercom-phpdependency:composer update intercom/intercom-php.Changes in this version:
IntercomClientconstructor third parameter now only accepts a key-value array of request headers, that will be included in every request, eg:new IntercomClient('token', null, ['Custom-Header' => 'value']);. If you were passing any other options to the client (apart from headers), you will need to instantiate your own client and pass it using thesetHttpClientmethod. Example:$httpClient = new Http\Adapter\Guzzle6\Client( new GuzzleHttp\Client(['connect_timeout' => 5]); ); $client = new IntercomClient('token'); $client->setHttpClient($httpClient);
IntercomClientmethodsetClienthas been renamed tosetHttpClient. Its first argument must be aPsr\Http\Client\ClientInterface. If you were using this method before upgrading, you can use the Guzzle6 adapter like in the example above. For example,$client->setClient($guzzleClient)would need to be changed to$client->setHttpClient(new Http\Adapter\Guzzle6\Client($guzzleClient)).
IntercomClientno longer exposes the methodsgetGuzzleRequestOptionsandgetAuth.
IntercomClientnow provides the methodssetRequestFactoryandsetUriFactoryso you can customize the generation of requests and URIs if needed.From now on, all the exceptions thrown by the SDK will implement
Http\Client\Exception. See the different exceptions that can be thrown in the HTTPPlug documentation