PHP configuration
You can customize the behavior of the PHP SDK generator in generators.yml:
SDK configuration options
clientName
Sets the name of the generated API client class. This determines the primary client type name that users will interact with in the generated PHP SDK.
composerJson
Allows customization of the generated composer.json file contents. You can specify additional metadata, dependencies, or configuration that will be merged into the package’s composer configuration file.
enable-wire-tests
When enabled, generates mock server (wire) tests to verify that the SDK sends and receives HTTP requests as expected.
inlinePathParameters
When enabled, path parameters are included as properties in the request class instead of being passed as separate method parameters. This creates a more unified request structure where all parameters are grouped together in the request object.
maxRetries
The default number of retries for failed requests. When not set, the generated SDK uses its own built-in default. SDK users can still override this per-request via request options.
namespace
Specifies the PHP namespace for all generated code. This determines the namespace hierarchy that users will use when importing and using the SDK classes.
offsetSemantics
Controls how the offset parameter is interpreted for auto-paginated endpoints.
item-index: The offset counts individual items (e.g., offset 20 skips the first 20 items).page-index: The offset counts pages (e.g., offset 3 skips to page 3).
omitFernHeaders
When enabled, the generated SDK omits the X-Fern-Language, X-Fern-SDK-Name, and X-Fern-SDK-Version headers from HTTP requests.
packageName
Sets the name of the PHP package as it will appear in Composer and Packagist. This is the name users will use to install the SDK via Composer (e.g., composer require your/package-name).
packagePath
Specifies the directory path where the generated SDK source files should be placed. This determines the file system location of the generated PHP code relative to the output directory.
propertyAccess
Controls the access level of generated class properties. When set to ‘public’, properties are public and getter/setter methods are omitted. When set to ‘private’, properties are private and getter/setter methods are generated for encapsulation.