PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.19
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.19
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
woocommerce-pos / vendor_prefixed / sentry / sentry / src / ExceptionMechanism.php

ExceptionMechanism.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.19, at vendor_prefixed/sentry/sentry/src/ExceptionMechanism.php

83 lines 2.6 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 namespace WCPOS\Vendor\Sentry;
5
6 /**
7 * The exception mechanism is an optional field residing in the Exception Interface.
8 * It carries additional information about the way the exception was created on the
9 * target system. This includes general exception values obtained from operating
10 * system or runtime APIs, as well as mechanism-specific values.
11 */
12 final class ExceptionMechanism
13 {
14 public const TYPE_GENERIC = 'generic';
15 /**
16 * @var string Unique identifier of this mechanism determining rendering and
17 * processing of the mechanism data
18 */
19 private $type;
20 /**
21 * @var bool Flag indicating whether the exception has been handled by the
22 * user (e.g. via try..catch)
23 */
24 private $handled;
25 /**
26 * @var array<string, mixed> Arbitrary extra data that might help the user
27 * understand the error thrown by this mechanism
28 */
29 private $data;
30 /**
31 * Class constructor.
32 *
33 * @param string $type Unique identifier of this mechanism determining
34 * rendering and processing of the mechanism data
35 * @param bool $handled Flag indicating whether the exception has been
36 * handled by the user (e.g. via try..catch)
37 * @param array<string, mixed> $data Arbitrary extra data that might help the user
38 * understand the error thrown by this mechanism
39 */
40 public function __construct(string $type, bool $handled, array $data = [])
41 {
42 $this->type = $type;
43 $this->handled = $handled;
44 $this->data = $data;
45 }
46 /**
47 * Returns the unique identifier of this mechanism determining rendering and
48 * processing of the mechanism data.
49 */
50 public function getType() : string
51 {
52 return $this->type;
53 }
54 /**
55 * Returns the flag indicating whether the exception has been handled by the
56 * user (e.g. via try..catch).
57 */
58 public function isHandled() : bool
59 {
60 return $this->handled;
61 }
62 /**
63 * Returns arbitrary extra data that might help the user understand the error
64 * thrown by this mechanism.
65 *
66 * @return array<string, mixed>
67 */
68 public function getData() : array
69 {
70 return $this->data;
71 }
72 /**
73 * Sets the arbitrary extra data.
74 *
75 * @param array<string, mixed> $data
76 */
77 public function setData(array $data) : self
78 {
79 $this->data = $data;
80 return $this;
81 }
82 }
83