diff --git a/app/Listeners/CacheAvatarPreview.php b/app/Listeners/CacheAvatarPreview.php index c4c12441..99faa9e1 100644 --- a/app/Listeners/CacheAvatarPreview.php +++ b/app/Listeners/CacheAvatarPreview.php @@ -5,11 +5,10 @@ namespace App\Listeners; use Cache; use Storage; use App\Services\Minecraft; -use App\Events\GetAvatarPreview; class CacheAvatarPreview { - public function handle(GetAvatarPreview $event) + public function handle($event) { $texture = $event->texture; $size = $event->size; diff --git a/app/Listeners/CachePlayerExists.php b/app/Listeners/CachePlayerExists.php index 809ae679..793a2ac4 100644 --- a/app/Listeners/CachePlayerExists.php +++ b/app/Listeners/CachePlayerExists.php @@ -15,7 +15,7 @@ class CachePlayerExists $events->listen(Events\PlayerWasAdded::class, [$this, 'forget']); } - public function remember(Events\CheckPlayerExists $event) + public function remember($event) { $key = "notfound-{$event->playerName}"; @@ -34,7 +34,7 @@ class CachePlayerExists } } - public function forget(Events\PlayerWasAdded $event) + public function forget($event) { Cache::forget("notfound-{$event->player->name}"); } diff --git a/app/Listeners/CachePlayerJson.php b/app/Listeners/CachePlayerJson.php index c4f2026a..c160f316 100644 --- a/app/Listeners/CachePlayerJson.php +++ b/app/Listeners/CachePlayerJson.php @@ -3,20 +3,19 @@ namespace App\Listeners; use Cache; +use App\Events; use App\Models\Player; -use App\Events\GetPlayerJson; -use App\Events\PlayerProfileUpdated; use Illuminate\Contracts\Events\Dispatcher; class CachePlayerJson { public function subscribe(Dispatcher $events) { - $events->listen(GetPlayerJson::class, [$this, 'remember']); - $events->listen(PlayerProfileUpdated::class, [$this, 'forget']); + $events->listen(Events\GetPlayerJson::class, [$this, 'remember']); + $events->listen(Events\PlayerProfileUpdated::class, [$this, 'forget']); } - public function remember(GetPlayerJson $event) + public function remember($event) { $key = "json-{$event->player->pid}-{$event->apiType}"; $content = Cache::rememberForever($key, function () use ($event) { @@ -26,7 +25,7 @@ class CachePlayerJson return $content; } - public function forget(PlayerProfileUpdated $event) + public function forget($event) { Cache::forget("json-{$event->player->pid}-".Player::CSL_API); Cache::forget("json-{$event->player->pid}-".Player::USM_API); diff --git a/app/Listeners/CacheSkinPreview.php b/app/Listeners/CacheSkinPreview.php index f9523f2d..ed6c87bd 100644 --- a/app/Listeners/CacheSkinPreview.php +++ b/app/Listeners/CacheSkinPreview.php @@ -8,7 +8,7 @@ use App\Services\Minecraft; class CacheSkinPreview { - public function handle(\App\Events\GetSkinPreview $event) + public function handle($event) { $texture = $event->texture; $size = $event->size; diff --git a/app/Listeners/ResetInvalidTextureForPlayer.php b/app/Listeners/ResetInvalidTextureForPlayer.php index 1d5fdd81..b71b3c8e 100644 --- a/app/Listeners/ResetInvalidTextureForPlayer.php +++ b/app/Listeners/ResetInvalidTextureForPlayer.php @@ -4,7 +4,7 @@ namespace App\Listeners; class ResetInvalidTextureForPlayer { - public function handle(\App\Events\PlayerRetrieved $event) + public function handle($event) { $player = $event->player; diff --git a/app/Listeners/TextureRemoved.php b/app/Listeners/TextureRemoved.php index 00c975e8..55e0ee8d 100644 --- a/app/Listeners/TextureRemoved.php +++ b/app/Listeners/TextureRemoved.php @@ -6,17 +6,7 @@ use App\Models\User; class TextureRemoved { - /** - * @var User - */ - protected $users; - - public function __construct(User $users) - { - $this->users = $users; - } - - public function handle(\App\Events\TextureDeleting $event) + public function handle($event) { $texture = $event->texture; @@ -28,7 +18,7 @@ class TextureRemoved } }); - if ($uploader = $this->users->find($texture->uploader)) { + if ($uploader = User::find($texture->uploader)) { $ret = 0; if (option('return_score')) { $ret += $texture->size * (