Skip to content

Commit

Permalink
refactor: clean up repositories and old APIs (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyksaw authored Oct 13, 2024
1 parent 3c1a181 commit e8ebf80
Show file tree
Hide file tree
Showing 91 changed files with 539 additions and 4,321 deletions.
12 changes: 0 additions & 12 deletions app/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\Rules\Password;
use Repositories\GameIPBans\GameIPBanEloquentRepository;
use Repositories\GameIPBans\GameIPBanRepository;
use Repositories\PlayerWarnings\PlayerWarningEloquentRepository;
use Repositories\PlayerWarnings\PlayerWarningRepository;
use Stripe\StripeClient;

final class AppServiceProvider extends ServiceProvider
Expand All @@ -48,14 +44,6 @@ public function register()
abstract: PlayerLookup::class,
concrete: ConcretePlayerLookup::class,
);
$this->app->bind(
abstract: GameIPBanRepository::class,
concrete: GameIPBanEloquentRepository::class,
);
$this->app->bind(
abstract: PlayerWarningRepository::class,
concrete: PlayerWarningEloquentRepository::class,
);
}

/**
Expand Down
41 changes: 0 additions & 41 deletions app/Core/Data/MinecraftUUID.php

This file was deleted.

14 changes: 0 additions & 14 deletions app/Core/Data/PlayerIdentifierType.php

This file was deleted.

43 changes: 0 additions & 43 deletions app/Core/Domains/PlayerLookup/Data/PlayerIdentifier.php

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions app/Core/Domains/PlayerLookup/Player.php

This file was deleted.

66 changes: 0 additions & 66 deletions app/Core/Domains/PlayerLookup/Service/ConcretePlayerLookup.php

This file was deleted.

17 changes: 0 additions & 17 deletions app/Core/Domains/PlayerLookup/Service/PlayerLookup.php

This file was deleted.

25 changes: 0 additions & 25 deletions app/Core/Domains/PlayerLookup/Service/PlayerLookupMock.php

This file was deleted.

16 changes: 0 additions & 16 deletions app/Core/Support/Horizon/HorizonServiceProvider.php

This file was deleted.

18 changes: 8 additions & 10 deletions app/Domains/Badges/UseCases/GetBadges.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@

namespace App\Domains\Badges\UseCases;

use App\Core\Domains\PlayerLookup\Data\PlayerIdentifier;
use App\Core\Domains\PlayerLookup\Service\PlayerLookup;
use App\Core\Domains\MinecraftUUID\Data\MinecraftUUID;
use App\Models\Badge;
use App\Models\MinecraftPlayer;

final class GetBadges
{
public function __construct(
private readonly PlayerLookup $playerLookup,
) {}

public function execute(PlayerIdentifier $identifier): array
public function execute(MinecraftUUID $uuid): array
{
$account = $this->playerLookup
->find(identifier: $identifier)
?->getLinkedAccount();
$player = MinecraftPlayer::whereUuid($uuid)->first();
if ($player === null) {
return [];
}

$account = $player->account;
if ($account === null) {
return [];
}
Expand Down
Loading

0 comments on commit e8ebf80

Please sign in to comment.