PHP Design

Speakeasy-generated PHP SDKs are designed to be easy to use and debug. We've made choices to guide the design of the SDK optimally, such as:

  • Assisting the end user in using the right data types by using type hints and doc strings wherever possible.
  • Accurately serializing/deserializing JSON bodies based on the OpenAPI document by using the JMS Serializer (opens in a new tab).
  • Using Guzzle (opens in a new tab) as the HTTP client. However, like all our SDKs, you can easily swap in a custom client if desired.
  • Improving code readability and avoiding duplicating code with the utils module that contains methods for configuring the SDK and serializing/deserializing generated types.

If you have any feedback, suggestions for improvements, or want to ask for a new feature, please contact us on the #client-sdks channel in our public Slack (opens in a new tab).