. */ declare(strict_types=1); namespace FireflyIII\Providers; use FireflyIII\Repositories\ImportJob\ImportJobRepository; use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** * @codeCoverageIgnore * Class ImportServiceProvider. */ class ImportServiceProvider extends ServiceProvider { /** * Bootstrap the application services. */ public function boot(): void { } /** * Register the application services. */ public function register(): void { $this->app->bind( ImportJobRepositoryInterface::class, function (Application $app) { /** @var ImportJobRepositoryInterface $repository */ $repository = app(ImportJobRepository::class); if ($app->auth->check()) { $repository->setUser(auth()->user()); } return $repository; } ); } }