PHP Configuration

You can customize the behavior of the PHP SDK generator in generators.yml:

generators.yml
1groups:
2 php-sdk:
3 generators:
4 - name: fernapi/fern-php
5 version: 1.16.8
6 config:
7 clientName: YourClientName

SDK Configuration Options

clientName
string

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
Record<string, any>

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.

inlinePathParameters
boolean

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.

namespace
string

Specifies the PHP namespace for all generated code. This determines the namespace hierarchy that users will use when importing and using the SDK classes.

packageName
string

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
string

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
'public' | 'private'

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.