File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Illuminated \Console ;
4
+
5
+ use RuntimeException ;
6
+
7
+ class MutexRuntimeException extends RuntimeException
8
+ {
9
+ }
Original file line number Diff line number Diff line change 2
2
3
3
namespace Illuminated \Console ;
4
4
5
- use RuntimeException ;
6
5
use Symfony \Component \Console \Input \InputInterface ;
7
6
use Symfony \Component \Console \Output \OutputInterface ;
8
7
@@ -19,15 +18,15 @@ protected function initializeMutex()
19
18
{
20
19
$ mutex = new Mutex ($ this );
21
20
if (!$ mutex ->acquireLock ($ this ->getMutexTimeout ())) {
22
- throw new RuntimeException ('Command is running now! ' );
21
+ throw new MutexRuntimeException ('Command is running now! ' );
23
22
}
24
23
25
24
register_shutdown_function ([$ this , 'releaseMutexLock ' ], $ mutex );
26
25
}
27
26
28
27
public function getMutexStrategy ()
29
28
{
30
- return ( property_exists ($ this , 'mutexStrategy ' ) ? $ this ->mutexStrategy : 'file ' ) ;
29
+ return property_exists ($ this , 'mutexStrategy ' ) ? $ this ->mutexStrategy : 'file ' ;
31
30
}
32
31
33
32
public function setMutexStrategy ($ strategy )
@@ -37,7 +36,7 @@ public function setMutexStrategy($strategy)
37
36
38
37
public function getMutexTimeout ()
39
38
{
40
- return ( property_exists ($ this , 'mutexTimeout ' ) ? $ this ->mutexTimeout : 0 ) ;
39
+ return property_exists ($ this , 'mutexTimeout ' ) ? $ this ->mutexTimeout : 0 ;
41
40
}
42
41
43
42
public function setMutexTimeout ($ timeout )
You can’t perform that action at this time.
0 commit comments