Skip to content

Commit

Permalink
switch evidences to collection
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Jul 17, 2023
1 parent d05484d commit 8169269
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Data/Appeal.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Astrotomic\FogTradeSdk\Enums\AppealState;
use Carbon\CarbonImmutable;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Casts\DateTimeInterfaceCast;
Expand Down Expand Up @@ -65,7 +66,7 @@ public function alts(): array
->all();
}

public function evidences(): array
public function evidences(): Collection
{
preg_match_all('/https?\:\/\/[^\",\s]+/i', $this->evidence, $match);

Expand All @@ -74,7 +75,6 @@ public function evidences(): array
->map(fn (string $url) => trim(str_replace("\xE2\x80\x8B", '', $url)))
->unique()
->filter(fn (string $url) => filter_var($url, FILTER_VALIDATE_URL))
->values()
->all();
->values();
}
}
6 changes: 3 additions & 3 deletions src/Data/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Astrotomic\FogTradeSdk\Enums\ReportState;
use Carbon\CarbonImmutable;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Casts\DateTimeInterfaceCast;
Expand Down Expand Up @@ -61,7 +62,7 @@ public function victim(): ?SteamID
return rescue(fn () => new SteamID($steamid));
}

public function evidences(): array
public function evidences(): Collection
{
preg_match_all('/https?\:\/\/[^\,\s]+/i', $this->evidence, $match);

Expand All @@ -70,7 +71,6 @@ public function evidences(): array
->map(fn (string $url) => trim(str_replace("\xE2\x80\x8B", '', $url)))
->unique()
->filter(fn (string $url) => filter_var($url, FILTER_VALIDATE_URL))
->values()
->all();
->values();
}
}
1 change: 0 additions & 1 deletion src/FogTradeConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Saloon\Http\Response;
use Saloon\Traits\Plugins\AcceptsJson;
use Saloon\Traits\Plugins\AlwaysThrowOnErrors;
use Spatie\LaravelData\DataCollection;

class FogTradeConnector extends Connector implements HasPagination
{
Expand Down

0 comments on commit 8169269

Please sign in to comment.