PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.27
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.27
1.10.27 1.10.26 1.10.25 1.10.24 1.10.23 1.10.22 1.10.21 1.10.20 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 All 171 releases
woocommerce-pos / vendor_prefixed / sentry / sentry / src / Tracing / TransactionSource.php

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

79 lines 1.8 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\Tracing;
5
6 /**
7 * This enum represents all the possible types of transaction sources.
8 *
9 * @see https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations
10 */
11 final class TransactionSource implements \Stringable
12 {
13 /**
14 * @var string The value of the enum instance
15 */
16 private $value;
17 /**
18 * @var array<string, self> A list of cached enum instances
19 */
20 private static $instances = [];
21 private function __construct(string $value)
22 {
23 $this->value = $value;
24 }
25 /**
26 * User-defined name.
27 */
28 public static function custom() : self
29 {
30 return self::getInstance('custom');
31 }
32 /**
33 * Raw URL, potentially containing identifiers.
34 */
35 public static function url() : self
36 {
37 return self::getInstance('url');
38 }
39 /**
40 * Parametrized URL / route.
41 */
42 public static function route() : self
43 {
44 return self::getInstance('route');
45 }
46 /**
47 * Name of the view handling the request.
48 */
49 public static function view() : self
50 {
51 return self::getInstance('view');
52 }
53 /**
54 * Named after a software component, such as a function or class name.
55 */
56 public static function component() : self
57 {
58 return self::getInstance('component');
59 }
60 /**
61 * Name of a background task (e.g. a Celery task).
62 */
63 public static function task() : self
64 {
65 return self::getInstance('task');
66 }
67 public function __toString() : string
68 {
69 return $this->value;
70 }
71 private static function getInstance(string $value) : self
72 {
73 if (!isset(self::$instances[$value])) {
74 self::$instances[$value] = new self($value);
75 }
76 return self::$instances[$value];
77 }
78 }
79