Releases: phpfui/ConstantContact
POST needs json body
setGuzzleFactory should return self
V24.11.6 Minor fixes
Better return types for all methods
This is a fairly large update to this library and has a very minor breaking change.
- Methods (get, post, update, delete, etc) now return null instead of an empty array on error. You should change your code to coalesce return values to an empty array. For example
$endPoint->get();
becomes$endPoint->get() ?? []
if your code uses the return value as an array. - All normal methods (get, post, update, delete, etc) have corresponding Typed()* methods that return objects in the \PHPFUI\ConstantContact\Definition namespace according to the Constant Contact API YAML definition.
- Fixes were made in hydrating \PHPFUI\ConstantContact\Definition objects from arrays.
- The \PHPFUI\ConstantContact\Client now supports a GuzzleHttp factory so the user can control \GuzzleHttp\Client creation.
Thanks to @xpavp03 for all the suggestions and testing.
PHP 8.4
Reset next url for every request
The next url was not reset for new requests resulting in potential extra requests in the case of an error from Constant Contact API.
PHP 8.3
Construct definitions from text arrays
Definitions containing other Definitions can now be constructed from plain text arrays like those returned from the API.
PHP 8.2 Support
- PHP 8.2 support
- Session detection
- Updated actions
Support for Custom Fields and delete method
- Fixed a bug in delete methods. Thanks to @degive
- Implemented custom fields. Thanks to @mstrigkos
OAuth2 PKCE and new end point support
Constant Contact is turning off the old endpoints for this library after March 2022. You must update to this version before then. You will also need to create a new application on the Constant Contact Developer Portal.
Due to new authorization requirements, this library now requires sessions to be turned on. You must also change acquireAccessToken pass all $_GET variables in an array rather than just the code variable. See updated readme for all details.
Other improvements include updated Definition classes and stricter type checking.
Thanks to jmalko for testing.