mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 10:39:28 +00:00
Update the last providers.
This commit is contained in:
@@ -14,9 +14,10 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Repositories\ExportJob\ExportJobRepository;
|
||||
use FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface;
|
||||
use FireflyIII\Repositories\ImportJob\ImportJobRepository;
|
||||
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -72,16 +73,15 @@ class ExportJobServiceProvider extends ServiceProvider
|
||||
private function importJob()
|
||||
{
|
||||
$this->app->bind(
|
||||
'FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface',
|
||||
function (Application $app, array $arguments) {
|
||||
if (!isset($arguments[0]) && $app->auth->check()) {
|
||||
return app('FireflyIII\Repositories\ImportJob\ImportJobRepository', [auth()->user()]);
|
||||
}
|
||||
if (!isset($arguments[0]) && !$app->auth->check()) {
|
||||
throw new FireflyException('There is no user present.');
|
||||
ImportJobRepositoryInterface::class,
|
||||
function (Application $app) {
|
||||
/** @var ImportJobRepository $repository */
|
||||
$repository = app(ImportJobRepository::class);
|
||||
if ($app->auth->check()) {
|
||||
$repository->setUser(auth()->user());
|
||||
}
|
||||
|
||||
return app('FireflyIII\Repositories\ImportJob\ImportJobRepository', $arguments);
|
||||
return $repository;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ class RuleGroupServiceProvider extends ServiceProvider
|
||||
{
|
||||
$this->app->bind(
|
||||
RuleGroupRepositoryInterface::class,
|
||||
function (Application $app, array $arguments) {
|
||||
function (Application $app) {
|
||||
/** @var RuleGroupRepository $repository */
|
||||
$repository = app(RuleGroupRepository::class);
|
||||
if ($app->auth->check()) {
|
||||
|
@@ -14,7 +14,8 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Repositories\Rule\RuleRepository;
|
||||
use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -43,16 +44,14 @@ class RuleServiceProvider extends ServiceProvider
|
||||
public function register()
|
||||
{
|
||||
$this->app->bind(
|
||||
'FireflyIII\Repositories\Rule\RuleRepositoryInterface',
|
||||
function (Application $app, array $arguments) {
|
||||
if (!isset($arguments[0]) && $app->auth->check()) {
|
||||
return app('FireflyIII\Repositories\Rule\RuleRepository', [auth()->user()]);
|
||||
RuleRepositoryInterface::class,
|
||||
function (Application $app) {
|
||||
/** @var RuleRepository $repository */
|
||||
$repository = app(RuleRepository::class);
|
||||
if ($app->auth->check()) {
|
||||
$repository->setUser(auth()->user());
|
||||
}
|
||||
if (!isset($arguments[0]) && !$app->auth->check()) {
|
||||
throw new FireflyException('There is no user present.');
|
||||
}
|
||||
|
||||
return app('FireflyIII\Repositories\Rule\RuleRepository', $arguments);
|
||||
return $repository;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@@ -14,7 +14,8 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Support\Search\Search;
|
||||
use FireflyIII\Support\Search\SearchInterface;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -43,16 +44,15 @@ class SearchServiceProvider extends ServiceProvider
|
||||
public function register()
|
||||
{
|
||||
$this->app->bind(
|
||||
'FireflyIII\Support\Search\SearchInterface',
|
||||
function (Application $app, array $arguments) {
|
||||
if (!isset($arguments[0]) && $app->auth->check()) {
|
||||
return app('FireflyIII\Support\Search\Search', [auth()->user()]);
|
||||
}
|
||||
if (!isset($arguments[0]) && !$app->auth->check()) {
|
||||
throw new FireflyException('There is no user present.');
|
||||
SearchInterface::class,
|
||||
function (Application $app) {
|
||||
/** @var Search $search */
|
||||
$search = app(Search::class);
|
||||
if ($app->auth->check()) {
|
||||
$search->setUser(auth()->user());
|
||||
}
|
||||
|
||||
return app('FireflyIII\Support\Search\Search', $arguments);
|
||||
return $search;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@@ -14,7 +14,8 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Repositories\Tag\TagRepository;
|
||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -43,16 +44,16 @@ class TagServiceProvider extends ServiceProvider
|
||||
public function register()
|
||||
{
|
||||
$this->app->bind(
|
||||
'FireflyIII\Repositories\Tag\TagRepositoryInterface',
|
||||
function (Application $app, array $arguments) {
|
||||
if (!isset($arguments[0]) && $app->auth->check()) {
|
||||
return app('FireflyIII\Repositories\Tag\TagRepository', [auth()->user()]);
|
||||
}
|
||||
if (!isset($arguments[0]) && !$app->auth->check()) {
|
||||
throw new FireflyException('There is no user present.');
|
||||
TagRepositoryInterface::class,
|
||||
function (Application $app) {
|
||||
/** @var TagRepository $repository */
|
||||
$repository = app(TagRepository::class);
|
||||
|
||||
if ($app->auth->check()) {
|
||||
$repository->setUser(auth()->user());
|
||||
}
|
||||
|
||||
return app('FireflyIII\Repositories\Tag\TagRepository', $arguments);
|
||||
return $repository;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user