PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.20
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.20
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 1.9.15 1.9.16 All 164 releases
woocommerce-pos / vendor_prefixed / sentry / sentry / src / Tracing / SpanId.php

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

49 lines 1.1 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 use WCPOS\Vendor\Sentry\Util\SentryUid;
7 /**
8 * This class represents an span ID.
9 */
10 final class SpanId 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]{16}$/i', $value)) {
24 throw new \InvalidArgumentException('The $value argument must be a 16 characters long hexadecimal string.');
25 }
26 $this->value = $value;
27 }
28 /**
29 * Generates a new span ID.
30 */
31 public static function generate() : self
32 {
33 return new self(\substr(SentryUid::generate(), 0, 16));
34 }
35 /**
36 * Compares whether two objects are equals.
37 *
38 * @param SpanId $other The object to compare
39 */
40 public function isEqualTo(self $other) : bool
41 {
42 return $this->value === $other->value;
43 }
44 public function __toString() : string
45 {
46 return $this->value;
47 }
48 }
49