8000 [Lock] add type-hint whenever possible by Simperfit · Pull Request #33004 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function acquire($blocking = false): ?bool
/**
* {@inheritdoc}
*/
public function refresh($ttl = null)
public function refresh(float $ttl = null)
{
if (null === $ttl) {
$ttl = $this->ttl;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/PersistingStoreInterface.php
8000
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ public function exists(Key $key);
*
* @throws LockConflictedException
*/
public function putOffExpiration(Key $key, $ttl);
public function putOffExpiration(Key $key, float $ttl);
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/CombinedStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function waitAndSave(Key $key)
/**
* {@inheritdoc}
*/
public function putOffExpiration(Key $key, $ttl)
public function putOffExpiration(Key $key, float $ttl)
{
$successCount = 0;
$failureCount = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/FlockStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private function lock(Key $key, bool $blocking)
/**
* {@inheritdoc}
*/
public function putOffExpiration(Key $key, $ttl)
public function putOffExpiration(Key $key, float $ttl)
{
// do nothing, the flock locks forever.
}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/MemcachedStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function waitAndSave(Key $key)
/**
* {@inheritdoc}
*/
public function putOffExpiration(Key $key, $ttl)
public function putOffExpiration(Key $key, float $ttl)
{
if ($ttl < 1) {
throw new InvalidTtlException(sprintf('%s() expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/PdoStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function waitAndSave(Key $key)
/**
* {@inheritdoc}
*/
public function putOffExpiration(Key $key, $ttl)
public function putOffExpiration(Key $key, float $ttl)
{
if ($ttl < 1) {
throw new InvalidTtlException(sprintf('%s() expects a TTL greater or equals to 1 second. Got %s.', __METHOD__, $ttl));
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/RedisStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function waitAndSave(Key $key)
/**
* {@inheritdoc}
*/
public function putOffExpiration(Key $key, $ttl)
public function putOffExpiration(Key $key, float $ttl)
{
$script = '
if redis.call("GET", KEYS[1]) == ARGV[1] then
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/RetryTillSaveStore.php