Skip to content

Commit ca7047f

Browse files
committed
ICM: getStrategy made public.
1 parent 39b1c2b commit ca7047f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Mutex.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ class Mutex
2020
public function __construct(Command $command)
2121
{
2222
$this->command = $command;
23-
$this->strategy = $this->strategy();
23+
$this->strategy = $this->getStrategy();
2424
$this->ninja = new Ninja($command->getMutexName(), $this->strategy);
2525
}
2626

27-
private function strategy()
27+
public function getStrategy()
2828
{
29+
if (!empty($this->strategy)) {
30+
return $this->strategy;
31+
}
32+
2933
switch ($this->command->getMutexStrategy()) {
3034
case 'mysql':
3135
return new MySqlLock(env('DB_USERNAME'), env('DB_PASSWORD'), env('DB_HOST'));

0 commit comments

Comments
 (0)