Skip to content

Commit eecdb26

Browse files
committed
Keep promise interface
1 parent 43d8230 commit eecdb26

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/cache/src/CachePool.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Windwalker\Cache\Storage\PhpFileStorage;
2323
use Windwalker\Cache\Storage\StorageInterface;
2424
use Windwalker\Promise\Promise;
25+
use Windwalker\Promise\PromiseInterface;
2526
use Windwalker\Utilities\Assert\ArgumentsAssert;
2627

2728
/**
@@ -464,14 +465,16 @@ public function call(
464465
* ])->then(fn(array $values) => useValues($values))->wait();
465466
*
466467
* @psalm-param callable(CacheItem): mixed $handler
468+
*
469+
* @return Promise
467470
*/
468471
public function fetchAsync(
469472
string $key,
470473
callable $handler,
471474
DateInterval|int|null $ttl = null,
472475
float $beta = 1.0,
473476
bool $lock = true,
474-
): Promise {
477+
): PromiseInterface {
475478
if (!class_exists(Promise::class)) {
476479
throw new \DomainException('Please install `windwalker/promise` to use fetchAsync().');
477480
}

0 commit comments

Comments
 (0)