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 / ClientReport / Reason.php

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

84 lines 2.0 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\ClientReport;
5
6 class Reason
7 {
8 /**
9 * @var string
10 */
11 private $value;
12 /**
13 * @var array<self>
14 */
15 private static $instances = [];
16 public function __construct(string $value)
17 {
18 $this->value = $value;
19 }
20 public static function queueOverflow() : self
21 {
22 return self::getInstance('queue_overflow');
23 }
24 public static function cacheOverflow() : self
25 {
26 return self::getInstance('cache_overflow');
27 }
28 public static function bufferOverflow() : self
29 {
30 return self::getInstance('buffer_overflow');
31 }
32 public static function ratelimitBackoff() : self
33 {
34 return self::getInstance('ratelimit_backoff');
35 }
36 public static function networkError() : self
37 {
38 return self::getInstance('network_error');
39 }
40 public static function sampleRate() : self
41 {
42 return self::getInstance('sample_rate');
43 }
44 public static function beforeSend() : self
45 {
46 return self::getInstance('before_send');
47 }
48 public static function eventProcessor() : self
49 {
50 return self::getInstance('event_processor');
51 }
52 public static function sendError() : self
53 {
54 return self::getInstance('send_error');
55 }
56 public static function internalSdkError() : self
57 {
58 return self::getInstance('internal_sdk_error');
59 }
60 public static function insufficientData() : self
61 {
62 return self::getInstance('insufficient_data');
63 }
64 public static function backpressure() : self
65 {
66 return self::getInstance('backpressure');
67 }
68 public function getValue() : string
69 {
70 return $this->value;
71 }
72 public function __toString()
73 {
74 return $this->value;
75 }
76 private static function getInstance(string $value) : self
77 {
78 if (!isset(self::$instances[$value])) {
79 self::$instances[$value] = new self($value);
80 }
81 return self::$instances[$value];
82 }
83 }
84