Skip to content

Commit

Permalink
Change logic to log the supplied ClientConfiguration array
Browse files Browse the repository at this point in the history
  • Loading branch information
Hectorhammett committed Dec 10, 2024
1 parent 6876cb4 commit be199d5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/ClientOptionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private function buildClientOptions(array $options)
$apiEndpoint = $options['apiEndpoint'] ?? null;

// Keep track of the original user supplied options for logging the configuration
$clientSuppliedOptions = json_encode($options, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
$clientSuppliedOptions = $options;

// Merge defaults into $options starting from top level
// variables, then going into deeper nesting, so that
Expand All @@ -140,9 +140,7 @@ private function buildClientOptions(array $options)
}

// Log the user supplied configuration.
if ($clientSuppliedOptions) {
$this->logConfiguration($options['logger'], $clientSuppliedOptions);
}
$this->logConfiguration($options['logger'], $clientSuppliedOptions);

if (isset($options['logger'])) {
$options['credentialsConfig']['authHttpHandler'] = HttpHandlerFactory::build(logger: $options['logger']);
Expand Down Expand Up @@ -356,7 +354,7 @@ private function isBackwardsCompatibilityMode(): bool
* @param null|false|LoggerInterface $logger
* @param string $options
*/
private function logConfiguration(null|false|LoggerInterface $logger, string $options): void
private function logConfiguration(null|false|LoggerInterface $logger, array $options): void
{
if (!$logger) {
return;
Expand Down

0 comments on commit be199d5

Please sign in to comment.