Skip to content

Better return types for all methods

Compare
Choose a tag to compare
@phpfui phpfui released this 14 Nov 23:20
· 3 commits to main since this release

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.