diff --git a/src/Amplitude/AmplitudeConfig.php b/src/Amplitude/AmplitudeConfig.php index 3587eae..1beea8e 100644 --- a/src/Amplitude/AmplitudeConfig.php +++ b/src/Amplitude/AmplitudeConfig.php @@ -2,13 +2,13 @@ namespace AmplitudeExperiment\Amplitude; +use AmplitudeExperiment\Assignment\AssignmentConfig; +use AmplitudeExperiment\Assignment\AssignmentConfigBuilder; use AmplitudeExperiment\Http\FetchClientInterface; /** - * Configuration options for Amplitude. This is an object that can be created using - * a {@link AmplitudeConfigBuilder}. Example usage: - * - * AmplitudeConfigBuilder::builder()->serverZone("EU")->build(); + * Configuration options for Amplitude. The Amplitude object is created when you create an {@link AssignmentConfig}. + * Options should be set using {@link AssignmentConfigBuilder}. */ class AmplitudeConfig { @@ -33,9 +33,13 @@ class AmplitudeConfig * True to use batch API endpoint, False to use HTTP V2 API endpoint. */ public bool $useBatch; + /** + * The underlying HTTP client to use for requests, if this is not set, the default {@link GuzzleFetchClient} will be used. + */ public ?FetchClientInterface $fetchClient; /** * @var array + * The configuration for the underlying default {@link GuzzleFetchClient} client (if used). See {@link GUZZLE_DEFAULTS} for defaults. */ public array $guzzleClientConfig; diff --git a/src/Assignment/AssignmentConfig.php b/src/Assignment/AssignmentConfig.php index b02ff60..fc8931e 100644 --- a/src/Assignment/AssignmentConfig.php +++ b/src/Assignment/AssignmentConfig.php @@ -6,15 +6,27 @@ /** * Configuration options for assignment tracking. This is an object that can be created using - * a {@link AssignmentConfigBuilder}. Example usage: + * a {@link AssignmentConfigBuilder}, which also sets options for {@link AmplitudeConfig}. Example usage: * - * AssignmentConfigBuilder::builder('api-key')->build() + * ``` + * AssignmentConfigBuilder::builder('api-key')->minIdLength(10)->build(); + * ``` */ class AssignmentConfig { + /** + * The Amplitude Analytics API key. + */ public string $apiKey; + /** + * The maximum number of assignments stored in the assignment cache + */ public int $cacheCapacity; + /** + * Configuration options for the underlying {@link Amplitude} client. This is created when + * calling {@link AssignmentConfigBuilder::build()} and does not need to be explicitly set. + */ public AmplitudeConfig $amplitudeConfig; const DEFAULTS = [ diff --git a/src/Local/LocalEvaluationConfig.php b/src/Local/LocalEvaluationConfig.php index 6bc1ae5..23f4660 100644 --- a/src/Local/LocalEvaluationConfig.php +++ b/src/Local/LocalEvaluationConfig.php @@ -7,6 +7,14 @@ use AmplitudeExperiment\Logger\LogLevel; use Psr\Log\LoggerInterface; +/** + * Configuration options. This is an object that can be created using + * a {@link LocalEvaluationConfigBuilder}. Example usage: + * + *``` + * LocalEvaluationConfig::builder()->serverUrl("https://api.lab.amplitude.com/")->build(); + * ``` + */ class LocalEvaluationConfig { /** @@ -14,7 +22,7 @@ class LocalEvaluationConfig */ public ?LoggerInterface $logger; /** - * The log level to use for the logger. + * The {@link LogLevel} to use for the logger. */ public int $logLevel; /** @@ -29,12 +37,12 @@ class LocalEvaluationConfig public array $bootstrap; public ?AssignmentConfig $assignmentConfig; /** - * The underlying HTTP client to use for requests, if this is not set, the default GuzzleFetchClient will be used. + * The underlying HTTP client to use for requests, if this is not set, the default {@link GuzzleFetchClient} will be used. */ public ?FetchClientInterface $fetchClient; /** * @var array - * The configuration for the underlying default Guzzle client. See {@link GUZZLE_DEFAULTS} for defaults. + * The configuration for the underlying default {@link GuzzleFetchClient} client (if used). See {@link GUZZLE_DEFAULTS} for defaults. */ public array $guzzleClientConfig; diff --git a/src/Remote/RemoteEvaluationConfig.php b/src/Remote/RemoteEvaluationConfig.php index a3806b5..2a7971c 100644 --- a/src/Remote/RemoteEvaluationConfig.php +++ b/src/Remote/RemoteEvaluationConfig.php @@ -11,7 +11,9 @@ * Configuration options. This is an object that can be created using * a {@link RemoteEvaluationConfigBuilder}. Example usage: * - *`RemoteEvaluationConfig::builder()->serverUrl("https://api.lab.amplitude.com/")->build()` + *``` + * RemoteEvaluationConfig::builder()->serverUrl("https://api.lab.amplitude.com/")->build(); + * ``` */ class RemoteEvaluationConfig { @@ -20,7 +22,7 @@ class RemoteEvaluationConfig */ public ?LoggerInterface $logger; /** - * The log level to use for the logger. + * The {@link LogLevel} to use for the logger. */ public int $logLevel; /** @@ -28,12 +30,12 @@ class RemoteEvaluationConfig */ public string $serverUrl; /** - * The underlying HTTP client to use for requests, if this is not set, the default GuzzleFetchClient will be used. + * The underlying HTTP client to use for requests, if this is not set, the default {@link GuzzleFetchClient} will be used. */ public ?FetchClientInterface $fetchClient; /** * @var array - * The configuration for the underlying default Guzzle client. See {@link GUZZLE_DEFAULTS} for defaults. + * The configuration for the underlying default {@link GuzzleFetchClient} (if used). See {@link GUZZLE_DEFAULTS} for defaults. */ public array $guzzleClientConfig;