11
11
12
12
namespace Symfony \Component \Uid ;
13
13
14
+ use Symfony \Component \Uid \Exception \InvalidArgumentException ;
15
+
14
16
/**
15
17
* @author Nicolas Grekas <p@tchwork.com>
16
18
*/
@@ -29,41 +31,41 @@ abstract public static function isValid(string $uid): bool;
29
31
/**
30
32
* Creates an AbstractUid from an identifier represented in any of the supported formats.
31
33
*
32
- * @throws \ InvalidArgumentException When the passed value is not valid
34
+ * @throws InvalidArgumentException When the passed value is not valid
33
35
*/
34
36
abstract public static function fromString (string $ uid ): static ;
35
37
36
38
/**
37
- * @throws \ InvalidArgumentException When the passed value is not valid
39
+ * @throws InvalidArgumentException When the passed value is not valid
38
40
*/
39
41
public static function fromBinary (string $ uid ): static
40
42
{
41
43
if (16 !== \strlen ($ uid )) {
42
- throw new \ InvalidArgumentException ('Invalid binary uid provided. ' );
44
+ throw new InvalidArgumentException ('Invalid binary uid provided. ' );
43
45
}
44
46
45
47
return static ::fromString ($ uid );
46
48
}
47
49
48
50
/**
49
- * @throws \ InvalidArgumentException When the passed value is not valid
51
+ * @throws InvalidArgumentException When the passed value is not valid
50
52
*/
51
53
public static function fromBase58 (string $ uid ): static
52
54
{
53
55
if (22 !== \strlen ($ uid )) {
54
- throw new \ InvalidArgumentException ('Invalid base-58 uid provided. ' );
56
+ throw new InvalidArgumentException ('Invalid base-58 uid provided. ' );
55
57
}
56
58
57
59
return static ::fromString ($ uid );
58
60
}
59
61
60
62
/**
61
- * @throws \ InvalidArgumentException When the passed value is not valid
63
+ * @throws InvalidArgumentException When the passed value is not valid
62
64
*/
63
65
public static function fromBase32 (string $ uid ): static
64
66
{
65
67
if (26 !== \strlen ($ uid )) {
66
- throw new \ InvalidArgumentException ('Invalid base-32 uid provided. ' );
68
+ throw new InvalidArgumentException ('Invalid base-32 uid provided. ' );
67
69
}
68
70
69
71
return static ::fromString ($ uid );
@@ -72,12 +74,12 @@ public static function fromBase32(string $uid): static
72
74
/**
73
75
* @param string $uid A valid RFC 9562/4122 uid
74
76
*
75
- * @throws \ InvalidArgumentException When the passed value is not valid
77
+ * @throws InvalidArgumentException When the passed value is not valid
76
78
*/
77
79
public static function fromRfc4122 (string $ uid ): static
78
80
{
79
81
if (36 !== \strlen ($ uid )) {
80
- throw new \ InvalidArgumentException ('Invalid RFC4122 uid provided. ' );
82
+ throw new InvalidArgumentException ('Invalid RFC4122 uid provided. ' );
81
83
}
82
84
83
85
return static ::fromString ($ uid );
0 commit comments