You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/EventHint.php
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,13 @@ final class EventHint
16
16
*/
17
17
public$exception;
18
18
19
+
/**
20
+
* An object describing the mechanism of the original exception.
21
+
*
22
+
* @var ExceptionMechanism|null
23
+
*/
24
+
public$mechanism;
25
+
19
26
/**
20
27
* The stacktrace to set on the event.
21
28
*
@@ -43,13 +50,18 @@ public static function fromArray(array $hintData): self
43
50
{
44
51
$hint = newself();
45
52
$exception = $hintData['exception'] ?? null;
53
+
$mechanism = $hintData['mechanism'] ?? null;
46
54
$stacktrace = $hintData['stacktrace'] ?? null;
47
55
$extra = $hintData['extra'] ?? [];
48
56
49
57
if (null !== $exception && !$exceptioninstanceof \Throwable) {
50
58
thrownew \InvalidArgumentException(sprintf('The value of the "exception" field must be an instance of a class implementing the "%s" interface. Got: "%s".', \Throwable::class, get_debug_type($exception)));
51
59
}
52
60
61
+
if (null !== $mechanism && !$mechanisminstanceof ExceptionMechanism) {
62
+
thrownew \InvalidArgumentException(sprintf('The value of the "mechanism" field must be an instance of the "%s" class. Got: "%s".', ExceptionMechanism::class, get_debug_type($mechanism)));
63
+
}
64
+
53
65
if (null !== $stacktrace && !$stacktraceinstanceof Stacktrace) {
54
66
thrownew \InvalidArgumentException(sprintf('The value of the "stacktrace" field must be an instance of the "%s" class. Got: "%s".', Stacktrace::class, get_debug_type($stacktrace)));
55
67
}
@@ -59,6 +71,7 @@ public static function fromArray(array $hintData): self
0 commit comments