diff --git a/src/Illuminate/Console/CacheCommandMutex.php b/src/Illuminate/Console/CacheCommandMutex.php index be24e24e95e1..c1e9b0b0e9bc 100644 --- a/src/Illuminate/Console/CacheCommandMutex.php +++ b/src/Illuminate/Console/CacheCommandMutex.php @@ -1,7 +1,5 @@ cache = $cache; } + /** + * Attempt to obtain a command mutex for the given command. + * + * @param \Illuminate\Console\Command $command + * @return bool + */ public function create($command) { return $this->cache->store($this->store)->add( @@ -42,25 +46,37 @@ public function create($command) ); } - public function exists($command) + /** + * Release the mutex for the given command. + * + * @param \Illuminate\Console\Command $command + * @return bool + */ + public function release($command) { - return $this->cache->store($this->store)->has( + return $this->cache->store($this->store)->forget( $this->commandMutexName($command) ); } - public function release($command) + /** + * Determine if a command mutex exists for the given command. + * + * @param \Illuminate\Console\Command $command + * @return bool + */ + public function exists($command) { - return $this->cache->store($this->store)->forget( + return $this->cache->store($this->store)->has( $this->commandMutexName($command) ); } /** - * @param Command $command + * @param \Illuminate\Console\Command $command * @return string */ - protected function commandMutexName($command): string + protected function commandMutexName($command) { return 'framework'.DIRECTORY_SEPARATOR.'command-'.$command->getName(); } @@ -71,7 +87,7 @@ protected function commandMutexName($command): string * @param string|null $store * @return $this */ - public function useStore($store): static + public function useStore($store) { $this->store = $store; diff --git a/src/Illuminate/Console/CommandMutex.php b/src/Illuminate/Console/CommandMutex.php index 3b1a46a86d76..c883ebf629d1 100644 --- a/src/Illuminate/Console/CommandMutex.php +++ b/src/Illuminate/Console/CommandMutex.php @@ -1,7 +1,5 @@