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