@@ -42,8 +42,7 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | try { |
| 44 | 44 | return $this->fileSystem->deleteFile($path); |
| 45 | - } |
|
| 46 | - catch (InvalidPathException $e) { |
|
| 45 | + } catch (InvalidPathException $e) { |
|
| 47 | 46 | throw new LockInvalidPathException('', 0, $e); |
| 48 | 47 | } |
| 49 | 48 | } |
@@ -58,11 +57,9 @@ discard block |
||
| 58 | 57 | { |
| 59 | 58 | try { |
| 60 | 59 | return $this->fileSystem->createDir($path); |
| 61 | - } |
|
| 62 | - catch (InvalidPathException $e) { |
|
| 60 | + } catch (InvalidPathException $e) { |
|
| 63 | 61 | throw new LockInvalidPathException('', 0, $e); |
| 64 | - } |
|
| 65 | - catch (PathAlreadyExistsException $e) { |
|
| 62 | + } catch (PathAlreadyExistsException $e) { |
|
| 66 | 63 | throw new LockPathAlreadyExistsException('', 0, $e); |
| 67 | 64 | } |
| 68 | 65 | } |
@@ -75,11 +72,9 @@ discard block |
||
| 75 | 72 | { |
| 76 | 73 | try { |
| 77 | 74 | return $this->fileSystem->readFile($path); |
| 78 | - } |
|
| 79 | - catch (InvalidPathException $e) { |
|
| 75 | + } catch (InvalidPathException $e) { |
|
| 80 | 76 | throw new LockInvalidPathException('', 0, $e); |
| 81 | - } |
|
| 82 | - catch (FileNotFoundException $e) { |
|
| 77 | + } catch (FileNotFoundException $e) { |
|
| 83 | 78 | throw new LockFileNotFoundException('', 0, $e); |
| 84 | 79 | } |
| 85 | 80 | } |
@@ -92,11 +87,9 @@ discard block |
||
| 92 | 87 | { |
| 93 | 88 | try { |
| 94 | 89 | $this->fileSystem->writeFile($path, $content); |
| 95 | - } |
|
| 96 | - catch (InvalidPathException $e) { |
|
| 90 | + } catch (InvalidPathException $e) { |
|
| 97 | 91 | throw new LockInvalidPathException('', 0, $e); |
| 98 | - } |
|
| 99 | - catch (PathAlreadyExistsException $e) { |
|
| 92 | + } catch (PathAlreadyExistsException $e) { |
|
| 100 | 93 | throw new LockPathAlreadyExistsException('', 0, $e); |
| 101 | 94 | } |
| 102 | 95 | } |
@@ -73,11 +73,11 @@ |
||
| 73 | 73 | |
| 74 | 74 | $this->fileSystem->writeFile($this->getLockFilePath(), $myPid ?? getmypid()); |
| 75 | 75 | |
| 76 | - if (! $this->lockExists()) { |
|
| 76 | + if (!$this->lockExists()) { |
|
| 77 | 77 | throw new CouldNotCreateLockException(); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - if (! $this->isMine()) { |
|
| 80 | + if (!$this->isMine()) { |
|
| 81 | 81 | throw new CouldNotCreateLockException('Another process somehow locked before us!'); |
| 82 | 82 | } |
| 83 | 83 | |