@@ -53,15 +53,15 @@ public static function encode(
5353 #[\SensitiveParameter]
5454 string $ binString
5555 ): string {
56- if (extension_loaded ('sodium ' )) {
56+ if (\ extension_loaded ('sodium ' )) {
5757 $ variant = match (static ::class) {
58- Base64::class => SODIUM_BASE64_VARIANT_ORIGINAL ,
59- Base64UrlSafe::class => SODIUM_BASE64_VARIANT_URLSAFE ,
58+ Base64::class => \ SODIUM_BASE64_VARIANT_ORIGINAL ,
59+ Base64UrlSafe::class => \ SODIUM_BASE64_VARIANT_URLSAFE ,
6060 default => 0 ,
6161 };
6262 if ($ variant > 0 ) {
6363 try {
64- return sodium_bin2base64 ($ binString , $ variant );
64+ return \ sodium_bin2base64 ($ binString , $ variant );
6565 } catch (SodiumException $ ex ) {
6666 throw new RangeException ($ ex ->getMessage (), $ ex ->getCode (), $ ex );
6767 }
@@ -85,15 +85,15 @@ public static function encodeUnpadded(
8585 #[\SensitiveParameter]
8686 string $ src
8787 ): string {
88- if (extension_loaded ('sodium ' )) {
88+ if (\ extension_loaded ('sodium ' )) {
8989 $ variant = match (static ::class) {
90- Base64::class => SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING ,
91- Base64UrlSafe::class => SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING ,
90+ Base64::class => \ SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING ,
91+ Base64UrlSafe::class => \ SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING ,
9292 default => 0 ,
9393 };
9494 if ($ variant > 0 ) {
9595 try {
96- return sodium_bin2base64 ($ src , $ variant );
96+ return \ sodium_bin2base64 ($ src , $ variant );
9797 } catch (SodiumException $ ex ) {
9898 throw new RangeException ($ ex ->getMessage (), $ ex ->getCode (), $ ex );
9999 }
@@ -199,15 +199,15 @@ public static function decode(
199199 'Incorrect padding '
200200 );
201201 }
202- if (extension_loaded ('sodium ' )) {
202+ if (\ extension_loaded ('sodium ' )) {
203203 $ variant = match (static ::class) {
204- Base64::class => SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING ,
205- Base64UrlSafe::class => SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING ,
204+ Base64::class => \ SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING ,
205+ Base64UrlSafe::class => \ SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING ,
206206 default => 0 ,
207207 };
208208 if ($ variant > 0 ) {
209209 try {
210- return sodium_base642bin ($ encodedString , $ variant );
210+ return \ sodium_base642bin ($ encodedString , $ variant );
211211 } catch (SodiumException $ ex ) {
212212 throw new RangeException ($ ex ->getMessage (), $ ex ->getCode (), $ ex );
213213 }
0 commit comments