@@ -138,17 +138,17 @@ public function save(Key $key): void
138
138
$ this ->client ->putItem ([
139
139
'TableName ' => $ this ->tableName ,
140
140
'Item ' => [
141
- $ this ->idAttr => new AttributeValue ( ['S ' => $ this ->getHashedKey ($ key )]) ,
142
- $ this ->tokenAttr => new AttributeValue ( ['S ' => $ this ->getUniqueToken ($ key )]) ,
143
- $ this ->expirationAttr => new AttributeValue ( ['N ' => (string ) (\microtime () + $ this ->initialTtl )]) ,
141
+ $ this ->idAttr => ['S ' => $ this ->getHashedKey ($ key )],
142
+ $ this ->tokenAttr => ['S ' => $ this ->getUniqueToken ($ key )],
143
+ $ this ->expirationAttr => ['N ' => (string ) (\microtime () + $ this ->initialTtl )],
144
144
],
145
145
'ConditionExpression ' => 'attribute_not_exists(#key) OR #expires_at < :now ' ,
146
146
'ExpressionAttributeNames ' => [
147
147
'#key ' => $ this ->idAttr ,
148
148
'#expires_at ' => $ this ->expirationAttr ,
149
149
],
150
150
'ExpressionAttributeValues ' => [
151
- ':now ' => new AttributeValue ( ['N ' => (string ) \microtime ()]) ,
151
+ ':now ' => ['N ' => (string ) \microtime ()],
152
152
],
153
153
]);
154
154
} catch (ConditionalCheckFailedException ) {
@@ -211,9 +211,9 @@ public function putOffExpiration(Key $key, float $ttl): void
211
211
$ this ->client ->putItem ([
212
212
'TableName ' => $ this ->tableName ,
213
213
'Item ' => [
214
- $ this ->idAttr => new AttributeValue ( ['S ' => $ this ->getHashedKey ($ key )]) ,
215
- $ this ->tokenAttr => new AttributeValue ( ['S ' => $ uniqueToken ]) ,
216
- $ this ->expirationAttr => new AttributeValue ( ['N ' => (string ) (\microtime () + $ ttl )]) ,
214
+ $ this ->idAttr => ['S ' => $ this ->getHashedKey ($ key )],
215
+ $ this ->tokenAttr => ['S ' => $ uniqueToken ],
216
+ $ this ->expirationAttr => ['N ' => (string ) (\microtime () + $ ttl )],
217
217
],
218
218
'ConditionExpression ' => 'attribute_exists(#key) AND (#token = :token OR #expires_at <= :now) ' ,
219
219
'ExpressionAttributeNames ' => [
@@ -222,7 +222,7 @@ public function putOffExpiration(Key $key, float $ttl): void
222
222
'#token ' => $ this ->tokenAttr ,
223
223
],
224
224
'ExpressionAttributeValues ' => [
225
- ':now ' => new AttributeValue ( ['N ' => (string ) \microtime ()]) ,
225
+ ':now ' => ['N ' => (string ) \microtime ()],
226
226
':token ' => $ uniqueToken ,
227
227
],
228
228
]);
0 commit comments