PluginProbe
DecaLog / 4.4.0
DecaLog v4.4.0
3.0.2 3.1.0 3.10.0 3.2.0 3.3.0 3.4.0 3.4.1 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.6.3 3.7.0 3.7.1 3.8.0 3.9.0 3.9.1 4.0.0 4.1.0 4.2.0 4.3.0 4.3.1 4.4.0 4.5.0 All 75 releases
decalog / includes / libraries / lock / exception / LockReleaseException.php

LockReleaseException.php in DecaLog 4.4.0, at includes/libraries/lock/exception/LockReleaseException.php

87 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace malkusch\lock\exception;
6
7 use Throwable;
8
9 /**
10 * Lock release exception.
11 *
12 * Failed to release the lock. Take this exception very serious. Failing to
13 * release a lock might have the potential to introduce deadlocks. Also the
14 * critical code was executed i.e. side effects may have happened.
15 *
16 * @author Markus Malkusch <markus@malkusch.de>
17 * @link bitcoin:1P5FAZ4QhXCuwYPnLZdk3PJsqePbu1UDDA Donations
18 * @license WTFPL
19 */
20 class LockReleaseException extends MutexException
21 {
22 /**
23 * Result that has been returned during the critical code execution.
24 *
25 * @var mixed
26 */
27 private $codeResult;
28
29 /**
30 * Exception that has happened during the critical code execution.
31 *
32 * @var \Throwable|null
33 */
34 private $codeException;
35
36 /**
37 * Gets the result that has been returned during the critical code
38 * execution.
39 *
40 * @return mixed The return value of the executed code block.
41 */
42 public function getCodeResult()
43 {
44 return $this->codeResult;
45 }
46
47 /**
48 * Sets the result that has been returned during the critical code
49 * execution.
50 *
51 * @param mixed $codeResult The return value of the executed code block.
52 * @return self Current lock release exception instance.
53 */
54 public function setCodeResult($codeResult): self
55 {
56 $this->codeResult = $codeResult;
57
58 return $this;
59 }
60
61 /**
62 * Gets the exception that has happened during the synchronized code
63 * execution.
64 *
65 * @return \Throwable|null The exception thrown by the code block or null
66 * when there has been no exception.
67 */
68 public function getCodeException(): ?Throwable
69 {
70 return $this->codeException;
71 }
72
73 /**
74 * Sets the exception that has happened during the critical code
75 * execution.
76 *
77 * @param \Throwable $codeException The exception thrown by the code block.
78 * @return self Current lock release exception instance.
79 */
80 public function setCodeException(Throwable $codeException): self
81 {
82 $this->codeException = $codeException;
83
84 return $this;
85 }
86 }
87