Skip to content

Commit d6d7ab9

Browse files
committed
refactor: remove Str dependency in SteamID and replace with native PHP functions
1 parent 7de30ac commit d6d7ab9

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/SteamID.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Astrotomic\SteamSdk;
44

55
use Closure;
6-
use Illuminate\Support\Str;
76
use InvalidArgumentException;
87
use Stringable;
98
use xPaw\Steam\SteamID as xPawSteamID;
@@ -19,7 +18,7 @@ public static function make(string|int $id): self
1918

2019
public function __construct(string|int $id)
2120
{
22-
if (is_numeric($id) && Str::isMatch('/^\d+$/', $id)) {
21+
if (is_numeric($id) && preg_match('/^\d+$/', $id) === 1) {
2322
$id = (int) $id;
2423
}
2524

@@ -36,7 +35,7 @@ function (string|int $id): ?xPawSteamID {
3635
},
3736
function (string|int $id): ?xPawSteamID {
3837
if (is_string($id) && str_starts_with($id, 'steam:')) {
39-
return new xPawSteamID(hexdec(Str::after($id, 'steam:')));
38+
return new xPawSteamID(hexdec(substr($id, 6)));
4039
}
4140

4241
return null;

0 commit comments

Comments
 (0)