THIS IS A BREAKING CHANGE RELEASE.
Added
- Support for version 2 of the API. Components specific to this version are under the
Zoho\Crm\V2namespace. Notably, the client class isZoho\Crm\V2\Client.- The API support is divided into "sub-APIs", which are helpers that regroup multiple related features of the API. They are attached to the client and you can access them as public properties (e.g.:
$client->theSubApi). Currently available sub-APIs arerecordsandusers. See README.md for further documentation. - The client needs an "access token store" object to handle its API access token persistency. There are multiple basic implementations available in namespace
Zoho\Crm\V2\AccessTokenStores. It must implementStoreInterface.
- The API support is divided into "sub-APIs", which are helpers that regroup multiple related features of the API. They are attached to the client and you can access them as public properties (e.g.:
- Compatibility with Guzzle 7.
- Compatibility with PHP 8.
- Compatibility with Doctrine Inflector 2.
Zoho\Crm\Contracts\ErrorHandlerInterface.createFromStringstatic method toZoho\Crm\Support\UrlParameters.getRawmethod to all queries (v1 and v2), to get the raw contents of the API response.Zoho\Crm\V2\Scopesutility class.Zoho\Crm\Utils\OAuthHelperutility class.Zoho\Crm\PreferencesContainerbase class for client preferences. It adds a newisSetmethod to check if a preference value is notnull.
Changed
- Composer package has been renamed
tristanjahier/zoho-crm. - Everything specific to version 1 of the API has been moved under the dedicated
Zoho\Crm\V1namespace. Notably, the client class is nowZoho\Crm\V1\Client. - Dependency injection in
Zoho\Crm\QueryProcessoris now mandatory. Arguments$requestSenderand$responseParserare not optional anymore, and$errorHandlerhas been added. Zoho\Crm\RequestSenderconstructor does not accept a$preferencesargument anymore.- Denominations of "HTTP verb" have been changed for "HTTP method" everywhere in the code. Because of that, the
getHttpVerbmethod ofZoho\Crm\Contracts\RequestableInterfacehas been renamedgetHttpMethod, and theZoho\Crm\Support\HttpVerbclass has been renamedZoho\Crm\Support\HttpMethod. - Method
setHttpMethodof queries now throws an exception (Zoho\Crm\Exceptions\InvalidHttpMethodException) when an invalid value is provided. - Denominations of "URI" have been changed for "URL" everywhere in the code. More information below.
- In
RequestableInterface, methodsetUrihas been removed. Other methods have been renamed:getUri => getUrl,setUriParameter => setUrlParameter. New methods have been added:getUrlParameters,getUrlParameter,hasUrlParameter,removeUrlParameter. Query implementations have been changed accordingly. Notably:- Multiple methods of
Zoho\Crm\V1\Queryhave been renamed:setUriParameter => setUrlParameter,getParameters => getUrlParameters,getParameter => getUrlParameter,hasParameter => hasUrlParameter.resetParametershas also been renamed toresetUrlParametersfor consistency.
- Multiple methods of
- In
PaginatedQueryInterface, methodpaginatedhas been removed, methodisPaginatedhas been renamedmustBePaginatedAutomatically, and 2 other methods were added:mustBePaginatedConcurrentlyandgetConcurrency. Query implementations have been changed accordingly. Furthermore:- Method
paginated, used to turn on and off the automatic pagination of queries, has been renamedautoPaginated. - Method
mustFetchPagesAsynchronously, used to determine if pages must be fetched concurrently, has been renamedmustBePaginatedConcurrently.
- Method
- In
QueryInterface, methodgetClientwas added. Zoho\Crm\Support\UrlParametersnow supports string-casting for all implementations ofDateTimeInterface, instead of just instances ofDateTime.Zoho\Crm\Exceptions\InvalidQueryExceptionnow shows the HTTP method in its message.Zoho\Crm\Support\Collectionnow implementsZoho\Crm\Support\Arrayable.
Fixed
- Client ID, client secret and refresh token are now sent to the authorization endpoint in the request body instead of the URL query string. This is considered a fix because it improves security by reducing the risk of exposing these secrets in clear in error messages.
Deprecated
- Installing from old Composer package name
tristanjahier/zoho-crm-php.
Development
- Upgraded dependencies:
phpunit/phpunit:5 -> 9symfony/var-dumper:4 -> 5