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 / Unit.php

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

142 lines 3.4 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 final class Unit implements \Stringable
7 {
8 /**
9 * @var string The value of the enum instance
10 */
11 private $value;
12 /**
13 * @var array<string, self> A list of cached enum instances
14 */
15 private static $instances = [];
16 private function __construct(string $value)
17 {
18 $this->value = $value;
19 }
20 public static function nanosecond() : self
21 {
22 return self::getInstance('nanosecond');
23 }
24 public static function microsecond() : self
25 {
26 return self::getInstance('microsecond');
27 }
28 public static function millisecond() : self
29 {
30 return self::getInstance('millisecond');
31 }
32 public static function second() : self
33 {
34 return self::getInstance('second');
35 }
36 public static function minute() : self
37 {
38 return self::getInstance('minute');
39 }
40 public static function hour() : self
41 {
42 return self::getInstance('hour');
43 }
44 public static function day() : self
45 {
46 return self::getInstance('day');
47 }
48 public static function week() : self
49 {
50 return self::getInstance('week');
51 }
52 public static function bit() : self
53 {
54 return self::getInstance('bit');
55 }
56 public static function byte() : self
57 {
58 return self::getInstance('byte');
59 }
60 public static function kilobyte() : self
61 {
62 return self::getInstance('kilobyte');
63 }
64 public static function kibibyte() : self
65 {
66 return self::getInstance('kibibyte');
67 }
68 public static function megabyte() : self
69 {
70 return self::getInstance('megabyte');
71 }
72 public static function mebibyte() : self
73 {
74 return self::getInstance('mebibyte');
75 }
76 public static function gigabyte() : self
77 {
78 return self::getInstance('gigabyte');
79 }
80 public static function gibibyte() : self
81 {
82 return self::getInstance('gibibyte');
83 }
84 public static function terabyte() : self
85 {
86 return self::getInstance('terabyte');
87 }
88 public static function tebibyte() : self
89 {
90 return self::getInstance('tebibyte');
91 }
92 public static function petabyte() : self
93 {
94 return self::getInstance('petabyte');
95 }
96 public static function pebibyte() : self
97 {
98 return self::getInstance('pebibyte');
99 }
100 public static function exabyte() : self
101 {
102 return self::getInstance('exabyte');
103 }
104 public static function exbibyte() : self
105 {
106 return self::getInstance('exbibyte');
107 }
108 public static function ratio() : self
109 {
110 return self::getInstance('ratio');
111 }
112 public static function percent() : self
113 {
114 return self::getInstance('percent');
115 }
116 /**
117 * @deprecated `none` is not supported and will be removed in 5.x
118 */
119 public static function none() : self
120 {
121 return self::getInstance('none');
122 }
123 /**
124 * @deprecated custom unit types are currently not supported. Will be removed in 5.x
125 */
126 public static function custom(string $unit) : self
127 {
128 return new self($unit);
129 }
130 public function __toString() : string
131 {
132 return $this->value;
133 }
134 private static function getInstance(string $value) : self
135 {
136 if (!isset(self::$instances[$value])) {
137 self::$instances[$value] = new self($value);
138 }
139 return self::$instances[$value];
140 }
141 }
142