Skip to content

Commit 41dacf7

Browse files
niravpateljoinxabbuh
authored andcommitted
Add @return non-empty-string annotations to AbstractUid and relevant functions
1 parent 0d28cf1 commit 41dacf7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Symfony/Component/Uid/AbstractUid.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,17 @@ public static function fromRfc4122(string $uid): static
8585

8686
/**
8787
* Returns the identifier as a raw binary string.
88+
*
89+
* @return non-empty-string
8890
*/
8991
abstract public function toBinary(): string;
9092

9193
/**
9294
* Returns the identifier as a base58 case-sensitive string.
9395
*
9496
* @example 2AifFTC3zXgZzK5fPrrprL (len=22)
97+
*
98+
* @return non-empty-string
9599
*/
96100
public function toBase58(): string
97101
{
@@ -104,6 +108,8 @@ public function toBase58(): string
104108
* @see https://tools.ietf.org/html/rfc4648#section-6
105109
*
106110
* @example 09EJ0S614A9FXVG9C5537Q9ZE1 (len=26)
111+
*
112+
* @return non-empty-string
107113
*/
108114
public function toBase32(): string
109115
{
@@ -127,6 +133,8 @@ public function toBase32(): string
127133
* @see https://datatracker.ietf.org/doc/html/rfc9562/#section-4
128134
*
129135
* @example 09748193-048a-4bfb-b825-8528cf74fdc1 (len=36)
136+
*
137+
* @return non-empty-string
130138
*/
131139
public function toRfc4122(): string
132140
{
@@ -143,6 +151,8 @@ public function toRfc4122(): string
143151
* Returns the identifier as a prefixed hexadecimal case insensitive string.
144152
*
145153
* @example 0x09748193048a4bfbb8258528cf74fdc1 (len=34)
154+
*
155+
* @return non-empty-string
146156
*/
147157
public function toHex(): string
148158
{
@@ -161,6 +171,9 @@ public function equals(mixed $other): bool
161171
return $this->uid === $other->uid;
162172
}
163173

174+
/**
175+
* @return non-empty-string
176+
*/
164177
public function hash(): string
165178
{
166179
return $this->uid;
@@ -171,16 +184,25 @@ public function compare(self $other): int
171184
return (\strlen($this->uid) - \strlen($other->uid)) ?: ($this->uid <=> $other->uid);
172185
}
173186

187+
/**
188+
* @return non-empty-string
189+
*/
174190
final public function toString(): string
175191
{
176192
return $this->__toString();
177193
}
178194

195+
/**
196+
* @return non-empty-string
197+
*/
179198
public function __toString(): string
180199
{
181200
return $this->uid;
182201
}
183202

203+
/**
204+
* @return non-empty-string
205+
*/
184206
public function jsonSerialize(): string
185207
{
186208
return $this->uid;

0 commit comments

Comments
 (0)