Skip to content

Commit d7f1bd9

Browse files
authored
feat: add enum support to Schedule::useCache() (#57311)
1 parent df826df commit d7f1bd9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Illuminate/Console/Scheduling/Schedule.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,13 @@ public function events()
432432
/**
433433
* Specify the cache store that should be used to store mutexes.
434434
*
435-
* @param string $store
435+
* @param \UnitEnum|string $store
436436
* @return $this
437437
*/
438438
public function useCache($store)
439439
{
440+
$store = enum_value($store);
441+
440442
if ($this->eventMutex instanceof CacheAware) {
441443
$this->eventMutex->useStore($store);
442444
}

src/Illuminate/Support/Facades/Schedule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @method static bool serverShouldRun(\Illuminate\Console\Scheduling\Event $event, \DateTimeInterface $time)
1515
* @method static \Illuminate\Support\Collection dueEvents(\Illuminate\Contracts\Foundation\Application $app)
1616
* @method static \Illuminate\Console\Scheduling\Event[] events()
17-
* @method static \Illuminate\Console\Scheduling\Schedule useCache(string $store)
17+
* @method static \Illuminate\Console\Scheduling\Schedule useCache(\UnitEnum|string $store)
1818
* @method static void macro(string $name, object|callable $macro)
1919
* @method static void mixin(object $mixin, bool $replace = true)
2020
* @method static bool hasMacro(string $name)

0 commit comments

Comments
 (0)