PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.21
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.21
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 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 All 166 releases
woocommerce-pos / vendor_prefixed / sentry / sentry / src / Tracing / TraceId.php

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

40 lines 867 B
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 use WCPOS\Vendor\Sentry\Util\SentryUid;
7 /**
8 * This class represents an trace ID.
9 */
10 final class TraceId implements \Stringable
11 {
12 /**
13 * @var string The ID
14 */
15 private $value;
16 /**
17 * Class constructor.
18 *
19 * @param string $value The ID
20 */
21 public function __construct(string $value)
22 {
23 if (!\preg_match('/^[a-f0-9]{32}$/i', $value)) {
24 throw new \InvalidArgumentException('The $value argument must be a 32 characters long hexadecimal string.');
25 }
26 $this->value = $value;
27 }
28 /**
29 * Generates a new trace ID.
30 */
31 public static function generate() : self
32 {
33 return new self(SentryUid::generate());
34 }
35 public function __toString() : string
36 {
37 return $this->value;
38 }
39 }
40