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