@@ -85,13 +85,17 @@ public static function fromRfc4122(string $uid): static
85
85
86
86
/**
87
87
* Returns the identifier as a raw binary string.
88
+ *
89
+ * @return non-empty-string
88
90
*/
89
91
abstract public function toBinary (): string ;
90
92
91
93
/**
92
94
* Returns the identifier as a base58 case-sensitive string.
93
95
*
94
96
* @example 2AifFTC3zXgZzK5fPrrprL (len=22)
97
+ *
98
+ * @return non-empty-string
95
99
*/
96
100
public function toBase58 (): string
97
101
{
@@ -104,6 +108,8 @@ public function toBase58(): string
104
108
* @see https://tools.ietf.org/html/rfc4648#section-6
105
109
*
106
110
* @example 09EJ0S614A9FXVG9C5537Q9ZE1 (len=26)
111
+ *
112
+ * @return non-empty-string
107
113
*/
108
114
public function toBase32 (): string
109
115
{
@@ -127,6 +133,8 @@ public function toBase32(): string
127
133
* @see https://datatracker.ietf.org/doc/html/rfc9562/#section-4
128
134
*
129
135
* @example 09748193-048a-4bfb-b825-8528cf74fdc1 (len=36)
136
+ *
137
+ * @return non-empty-string
130
138
*/
131
139
public function toRfc4122 (): string
132
140
{
@@ -143,6 +151,8 @@ public function toRfc4122(): string
143
151
* Returns the identifier as a prefixed hexadecimal case insensitive string.
144
152
*
145
153
* @example 0x09748193048a4bfbb8258528cf74fdc1 (len=34)
154
+ *
155
+ * @return non-empty-string
146
156
*/
147
157
public function toHex (): string
148
158
{
@@ -161,6 +171,9 @@ public function equals(mixed $other): bool
161
171
return $ this ->uid === $ other ->uid ;
162
172
}
163
173
174
+ /**
175
+ * @return non-empty-string
176
+ */
164
177
public function hash (): string
165
178
{
166
179
return $ this ->uid ;
@@ -171,16 +184,25 @@ public function compare(self $other): int
171
184
return (\strlen ($ this ->uid ) - \strlen ($ other ->uid )) ?: ($ this ->uid <=> $ other ->uid );
172
185
}
173
186
187
+ /**
188
+ * @return non-empty-string
189
+ */
174
190
final public function toString (): string
175
191
{
176
192
return $ this ->__toString ();
177
193
}
178
194
195
+ /**
196
+ * @return non-empty-string
197
+ */
179
198
public function __toString (): string
180
199
{
181
200
return $ this ->uid ;
182
201
}
183
202
203
+ /**
204
+ * @return non-empty-string
205
+ */
184
206
public function jsonSerialize (): string
185
207
{
186
208
return $ this ->uid ;
0 commit comments