Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4cef875

Browse filesBrowse files
committed
[Lock][WIP] Psalm InvalidArgument errors are confusing me...
1 parent 94bccf3 commit 4cef875
Copy full SHA for 4cef875

File tree

Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed

‎src/Symfony/Component/Lock/Bridge/DynamoDb/Store/DynamoDbStore.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Lock/Bridge/DynamoDb/Store/DynamoDbStore.php
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,17 @@ public function save(Key $key): void
138138
$this->client->putItem([
139139
'TableName' => $this->tableName,
140140
'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)],
144144
],
145145
'ConditionExpression' => 'attribute_not_exists(#key) OR #expires_at < :now',
146146
'ExpressionAttributeNames' => [
147147
'#key' => $this->idAttr,
148148
'#expires_at' => $this->expirationAttr,
149149
],
150150
'ExpressionAttributeValues' => [
151-
':now' => new AttributeValue(['N' => (string) \microtime()]),
151+
':now' => ['N' => (string) \microtime()],
152152
],
153153
]);
154154
} catch (ConditionalCheckFailedException) {
@@ -211,9 +211,9 @@ public function putOffExpiration(Key $key, float $ttl): void
211211
$this->client->putItem([
212212
'TableName' => $this->tableName,
213213
'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)],
217217
],
218218
'ConditionExpression' => 'attribute_exists(#key) AND (#token = :token OR #expires_at <= :now)',
219219
'ExpressionAttributeNames' => [
@@ -222,7 +222,7 @@ public function putOffExpiration(Key $key, float $ttl): void
222222
'#token' => $this->tokenAttr,
223223
],
224224
'ExpressionAttributeValues' => [
225-
':now' => new AttributeValue(['N' => (string) \microtime()]),
225+
':now' => ['N' => (string) \microtime()],
226226
':token' => $uniqueToken,
227227
],
228228
]);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.