Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 28, 2022
1 parent 5b2a379 commit 6dbc25c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/Illuminate/Console/Scheduling/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,18 @@ class Event
public $mutex;

/**
* The exit status code of the command.
* The mutex name resolver callback.
*
* @var int|null
* @var \Closure|null
*/
public $exitCode;
public $mutexNameResolver;

/**
* The mutex name resolver callback.
* The exit status code of the command.
*
* @var \Closure|null
* @var int|null
*/
public $createMutexNameCallback;
public $exitCode;

/**
* Create a new event instance.
Expand Down Expand Up @@ -942,24 +942,24 @@ public function preventOverlapsUsing(EventMutex $mutex)
*/
public function mutexName()
{
$createMutexNameUsing = $this->createMutexNameCallback;
$mutexNameResolver = $this->mutexNameResolver;

if (! is_null($createMutexNameUsing) && is_callable($createMutexNameUsing)) {
return $createMutexNameUsing($this);
if (! is_null($mutexNameResolver) && is_callable($mutexNameResolver)) {
return $mutexNameResolver($this);
}

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

/**
* Set the mutex name resolver callback.
* Set the mutex name or name resolver callback.
*
* @param \Closure $callback
* @param \Closure|string $mutexName
* @return $this
*/
public function createMutexNameUsing(Closure $callback)
public function createMutexNameUsing(Closure|string $mutexName)
{
$this->createMutexNameCallback = $callback;
$this->mutexNameResolver = is_string($mutexName) ? fn () => $mutexName : $mutexName;

return $this;
}
Expand Down

0 comments on commit 6dbc25c

Please sign in to comment.