Skip to content

Commit 6dbc25c

Browse files
committed
formatting
1 parent 5b2a379 commit 6dbc25c

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/Illuminate/Console/Scheduling/Event.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,18 @@ class Event
150150
public $mutex;
151151

152152
/**
153-
* The exit status code of the command.
153+
* The mutex name resolver callback.
154154
*
155-
* @var int|null
155+
* @var \Closure|null
156156
*/
157-
public $exitCode;
157+
public $mutexNameResolver;
158158

159159
/**
160-
* The mutex name resolver callback.
160+
* The exit status code of the command.
161161
*
162-
* @var \Closure|null
162+
* @var int|null
163163
*/
164-
public $createMutexNameCallback;
164+
public $exitCode;
165165

166166
/**
167167
* Create a new event instance.
@@ -942,24 +942,24 @@ public function preventOverlapsUsing(EventMutex $mutex)
942942
*/
943943
public function mutexName()
944944
{
945-
$createMutexNameUsing = $this->createMutexNameCallback;
945+
$mutexNameResolver = $this->mutexNameResolver;
946946

947-
if (! is_null($createMutexNameUsing) && is_callable($createMutexNameUsing)) {
948-
return $createMutexNameUsing($this);
947+
if (! is_null($mutexNameResolver) && is_callable($mutexNameResolver)) {
948+
return $mutexNameResolver($this);
949949
}
950950

951951
return 'framework'.DIRECTORY_SEPARATOR.'schedule-'.sha1($this->expression.$this->command);
952952
}
953953

954954
/**
955-
* Set the mutex name resolver callback.
955+
* Set the mutex name or name resolver callback.
956956
*
957-
* @param \Closure $callback
957+
* @param \Closure|string $mutexName
958958
* @return $this
959959
*/
960-
public function createMutexNameUsing(Closure $callback)
960+
public function createMutexNameUsing(Closure|string $mutexName)
961961
{
962-
$this->createMutexNameCallback = $callback;
962+
$this->mutexNameResolver = is_string($mutexName) ? fn () => $mutexName : $mutexName;
963963

964964
return $this;
965965
}

0 commit comments

Comments
 (0)