Repository: symfony/symfony
File: src/Symfony/Component/Lock/Bridge/DynamoDb/Store/DynamoDbStore.php (PHP)

Code before:
                'accessKeyId' => rawurldecode($params['user'] ?? '') ?: null,
                'accessKeySecret' => rawurldecode($params['pass'] ?? '') ?: null,
            ];
            if (null !== $options['session_token']) {
                $clientConfiguration['sessionToken'] = $options['session_token'];
            }
            if (isset($options['debug'])) {
                $clientConfiguration['debug'] = $options['debug'];
            }
            unset($query['region']);

            if ('default' !== ($params['host'] ?? 'default')) {
                $clientConfiguration['endpoint'] = \sprintf('%s://%s%s', ($options['sslmode'] ?? null) === 'disable' ? 'http' : 'https', $params['host'], ($params['port'] ?? null) ? ':'.$params['port'] : '');
                if (preg_match(';^dynamodb\.([^\.]++)\.amazonaws\.com$;', $params['host'], $matches)) {
                    $clientConfiguration['region'] = $matches[1];
                }
            } elseif (null !== ($options['endpoint'] ?? self::DEFAULT_OPTIONS['endpoint'])) {
                $clientConfiguration['endpoint'] = $options['endpoint'];
            }

            $parsedPath = explode('/', ltrim($params['path'] ?? '/', '/'));
            if ($tableName = end($parsedPath)) {
                $options['table_name'] = $tableName;
            }

            $this->client = new DynamoDbClient($clientConfiguration, null, $options['http_client'] ?? null);
        }

        $this->tableName = $options['table_name'] ?? self::DEFAULT_OPTIONS['table_name'];
        $this->idAttr = $options['id_attr'] ?? self::DEFAULT_OPTIONS['id_attr'];
        $this->tokenAttr = $options['token_attr'] ?? self::DEFAULT_OPTIONS['token_attr'];
        $this->expirationAttr = $options['expiration_attr'] ?? self::DEFAULT_OPTIONS['expiration_attr'];
        $this->readCapacityUnits = $options['read_capacity_units'] ?? self::DEFAULT_OPTIONS['read_capacity_units'];
        $this->writeCapacityUnits = $options['write_capacity_units'] ?? self::DEFAULT_OPTIONS['write_capacity_units'];
    }

    public function save(Key $key): void
    {
        $key->reduceLifetime($this->initialTtl);

        $input = new PutItemInput([
            'TableName' => $this->tableName,
            'Item' => [
                $this->idAttr => new AttributeValue(['S' => $this->getHashedKey($key)]),
                $this->tokenAttr => new AttributeValue(['S' => $this->getUniqueToken($key)]),
                $this->expirationAttr => new AttributeValue(['N' => (string) (microtime(true) + $this->initialTtl)]),
            ],
            'ConditionExpression' => 'attribute_not_exists(#key) OR #expires_at < :now',
            'ExpressionAttributeNames' => [
                '#key' => $this->idAttr,
                '#expires_at' => $this->expirationAttr,

Review comment (suggestion):
```suggestion
            $this->client = new DynamoDbClient($clientConfiguration, null, $options['http_client']);
```

Code after:
                'accessKeyId' => rawurldecode($params['user'] ?? '') ?: null,
                'accessKeySecret' => rawurldecode($params['pass'] ?? '') ?: null,
            ];
            if (null !== $options['session_token']) {
                $clientConfiguration['sessionToken'] = $options['session_token'];
            }
            if (isset($options['debug'])) {
                $clientConfiguration['debug'] = $options['debug'];
            }
            unset($query['region']);

            if ('default' !== ($params['host'] ?? 'default')) {
                $clientConfiguration['endpoint'] = \sprintf('%s://%s%s', ($options['sslmode'] ?? null) === 'disable' ? 'http' : 'https', $params['host'], ($params['port'] ?? null) ? ':'.$params['port'] : '');
                if (preg_match(';^dynamodb\.([^\.]++)\.amazonaws\.com$;', $params['host'], $matches)) {
                    $clientConfiguration['region'] = $matches[1];
                }
            } elseif (null !== ($options['endpoint'] ?? self::DEFAULT_OPTIONS['endpoint'])) {
                $clientConfiguration['endpoint'] = $options['endpoint'];
            }

            $parsedPath = explode('/', ltrim($params['path'] ?? '/', '/'));
            if ($tableName = end($parsedPath)) {
                $options['table_name'] = $tableName;
            }

            $this->client = new DynamoDbClient($clientConfiguration, null, $options['http_client']);
        }

        $this->tableName = $options['table_name'] ?? self::DEFAULT_OPTIONS['table_name'];
        $this->idAttr = $options['id_attr'] ?? self::DEFAULT_OPTIONS['id_attr'];
        $this->tokenAttr = $options['token_attr'] ?? self::DEFAULT_OPTIONS['token_attr'];
        $this->expirationAttr = $options['expiration_attr'] ?? self::DEFAULT_OPTIONS['expiration_attr'];
        $this->readCapacityUnits = $options['read_capacity_units'] ?? self::DEFAULT_OPTIONS['read_capacity_units'];
        $this->writeCapacityUnits = $options['write_capacity_units'] ?? self::DEFAULT_OPTIONS['write_capacity_units'];
    }

    public function save(Key $key): void
    {
        $key->reduceLifetime($this->initialTtl);

        $input = new PutItemInput([
            'TableName' => $this->tableName,
            'Item' => [
                $this->idAttr => new AttributeValue(['S' => $this->getHashedKey($key)]),
                $this->tokenAttr => new AttributeValue(['S' => $this->getUniqueToken($key)]),
                $this->expirationAttr => new AttributeValue(['N' => (string) (microtime(true) + $this->initialTtl)]),
            ],
            'ConditionExpression' => 'attribute_not_exists(#key) OR #expires_at < :now',
            'ExpressionAttributeNames' => [
                '#key' => $this->idAttr,
                '#expires_at' => $this->expirationAttr,