From 1295b03c3a1d91baa0f1688def84ecdf54cbbde0 Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Thu, 22 Jun 2023 18:59:19 -0500 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Dependency=20injection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Commands/TraktWatch.php | 4 ++-- app/Commands/TraktWatchImport.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Commands/TraktWatch.php b/app/Commands/TraktWatch.php index 24bb3b0..bb73083 100644 --- a/app/Commands/TraktWatch.php +++ b/app/Commands/TraktWatch.php @@ -11,11 +11,11 @@ class TraktWatch extends Command protected $signature = 'show:watch {file : File to watch}'; protected $description = 'Mark a show as watched right now on Trakt'; - public function handle(): int + public function handle(Trakt $trakt): int { $file = WatchFile::from($this->argument('file')); $data = WatchData::from(['rawData' => [$file->toArray()]]); - $resp = $this->app->make(Trakt::class)->syncHistory($data, $this->output); + $resp = $trakt->syncHistory($data, $this->output); return $resp->ok() ? static::SUCCESS : static::FAILURE; } diff --git a/app/Commands/TraktWatchImport.php b/app/Commands/TraktWatchImport.php index 4a6eeaf..0edd566 100644 --- a/app/Commands/TraktWatchImport.php +++ b/app/Commands/TraktWatchImport.php @@ -10,10 +10,10 @@ class TraktWatchImport extends Command protected $signature = 'show:watch:import {files* : JSON files to import}'; protected $description = 'Once online, sync watches from show:watch:export'; - public function handle(): int + public function handle(Trakt $trakt): int { $watched = WatchData::from($this->arguments()); - $resp = $this->app->make(Trakt::class)->syncHistory($watched, $this->output); + $resp = $trakt->syncHistory($watched, $this->output); return $resp->ok() ? static::SUCCESS : static::FAILURE; }