mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Update various service providers.
This commit is contained in:
parent
e057c4d79c
commit
615d90c8f4
@ -13,6 +13,28 @@ declare(strict_types = 1);
|
|||||||
|
|
||||||
namespace FireflyIII\Providers;
|
namespace FireflyIII\Providers;
|
||||||
|
|
||||||
|
use FireflyIII\Export\Processor;
|
||||||
|
use FireflyIII\Export\ProcessorInterface;
|
||||||
|
use FireflyIII\Generator\Chart\Basic\ChartJsGenerator;
|
||||||
|
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||||
|
use FireflyIII\Helpers\Attachments\AttachmentHelper;
|
||||||
|
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
||||||
|
use FireflyIII\Helpers\Chart\MetaPieChart;
|
||||||
|
use FireflyIII\Helpers\Chart\MetaPieChartInterface;
|
||||||
|
use FireflyIII\Helpers\FiscalHelper;
|
||||||
|
use FireflyIII\Helpers\FiscalHelperInterface;
|
||||||
|
use FireflyIII\Helpers\Help\Help;
|
||||||
|
use FireflyIII\Helpers\Help\HelpInterface;
|
||||||
|
use FireflyIII\Helpers\Report\BalanceReportHelper;
|
||||||
|
use FireflyIII\Helpers\Report\BalanceReportHelperInterface;
|
||||||
|
use FireflyIII\Helpers\Report\BudgetReportHelper;
|
||||||
|
use FireflyIII\Helpers\Report\BudgetReportHelperInterface;
|
||||||
|
use FireflyIII\Helpers\Report\ReportHelper;
|
||||||
|
use FireflyIII\Helpers\Report\ReportHelperInterface;
|
||||||
|
use FireflyIII\Import\ImportProcedure;
|
||||||
|
use FireflyIII\Import\ImportProcedureInterface;
|
||||||
|
use FireflyIII\Repositories\User\UserRepository;
|
||||||
|
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||||
use FireflyIII\Support\Amount;
|
use FireflyIII\Support\Amount;
|
||||||
use FireflyIII\Support\ExpandedForm;
|
use FireflyIII\Support\ExpandedForm;
|
||||||
use FireflyIII\Support\FireflyConfig;
|
use FireflyIII\Support\FireflyConfig;
|
||||||
@ -94,22 +116,22 @@ class FireflyServiceProvider extends ServiceProvider
|
|||||||
);
|
);
|
||||||
|
|
||||||
// chart generator:
|
// chart generator:
|
||||||
$this->app->bind('FireflyIII\Generator\Chart\Basic\GeneratorInterface', 'FireflyIII\Generator\Chart\Basic\ChartJsGenerator');
|
$this->app->bind(GeneratorInterface::class, ChartJsGenerator::class);
|
||||||
|
|
||||||
// chart builder
|
// chart builder
|
||||||
$this->app->bind('FireflyIII\Helpers\Chart\MetaPieChartInterface', 'FireflyIII\Helpers\Chart\MetaPieChart');
|
$this->app->bind(MetaPieChartInterface::class, MetaPieChart::class);
|
||||||
|
|
||||||
// other generators
|
// other generators
|
||||||
$this->app->bind('FireflyIII\Export\ProcessorInterface', 'FireflyIII\Export\Processor');
|
$this->app->bind(ProcessorInterface::class,Processor::class);
|
||||||
$this->app->bind('FireflyIII\Import\ImportProcedureInterface', 'FireflyIII\Import\ImportProcedure');
|
$this->app->bind(ImportProcedureInterface::class,ImportProcedure::class);
|
||||||
$this->app->bind('FireflyIII\Repositories\User\UserRepositoryInterface', 'FireflyIII\Repositories\User\UserRepository');
|
$this->app->bind(UserRepositoryInterface::class, UserRepository::class);
|
||||||
$this->app->bind('FireflyIII\Helpers\Attachments\AttachmentHelperInterface', 'FireflyIII\Helpers\Attachments\AttachmentHelper');
|
$this->app->bind(AttachmentHelperInterface::class, AttachmentHelper::class);
|
||||||
|
|
||||||
$this->app->bind('FireflyIII\Helpers\Help\HelpInterface', 'FireflyIII\Helpers\Help\Help');
|
$this->app->bind(HelpInterface::class, Help::class);
|
||||||
$this->app->bind('FireflyIII\Helpers\Report\ReportHelperInterface', 'FireflyIII\Helpers\Report\ReportHelper');
|
$this->app->bind(ReportHelperInterface::class, ReportHelper::class);
|
||||||
$this->app->bind('FireflyIII\Helpers\FiscalHelperInterface', 'FireflyIII\Helpers\FiscalHelper');
|
$this->app->bind(FiscalHelperInterface::class,FiscalHelper::class);
|
||||||
$this->app->bind('FireflyIII\Helpers\Report\BalanceReportHelperInterface', 'FireflyIII\Helpers\Report\BalanceReportHelper');
|
$this->app->bind(BalanceReportHelperInterface::class, BalanceReportHelper::class);
|
||||||
$this->app->bind('FireflyIII\Helpers\Report\BudgetReportHelperInterface', 'FireflyIII\Helpers\Report\BudgetReportHelper');
|
$this->app->bind(BudgetReportHelperInterface::class, BudgetReportHelper::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,8 @@ declare(strict_types = 1);
|
|||||||
namespace FireflyIII\Providers;
|
namespace FireflyIII\Providers;
|
||||||
|
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
|
use FireflyIII\Repositories\PiggyBank\PiggyBankRepository;
|
||||||
|
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
@ -44,16 +46,14 @@ class PiggyBankServiceProvider extends ServiceProvider
|
|||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
'FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface',
|
PiggyBankRepositoryInterface::class,
|
||||||
function (Application $app, array $arguments) {
|
function (Application $app) {
|
||||||
if (!isset($arguments[0]) && $app->auth->check()) {
|
/** @var PiggyBankRepository $repository */
|
||||||
return app('FireflyIII\Repositories\PiggyBank\PiggyBankRepository', [auth()->user()]);
|
$repository = app(PiggyBankRepository::class);
|
||||||
|
if ($app->auth->check()) {
|
||||||
|
$repository->setUser(auth()->user());
|
||||||
}
|
}
|
||||||
if (!isset($arguments[0]) && !$app->auth->check()) {
|
return $repository;
|
||||||
throw new FireflyException('There is no user present.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return app('FireflyIII\Repositories\PiggyBank\PiggyBankRepository', $arguments);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,8 @@ declare(strict_types = 1);
|
|||||||
|
|
||||||
namespace FireflyIII\Providers;
|
namespace FireflyIII\Providers;
|
||||||
|
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Repositories\RuleGroup\RuleGroupRepository;
|
||||||
|
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
@ -44,16 +45,15 @@ class RuleGroupServiceProvider extends ServiceProvider
|
|||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
'FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface',
|
RuleGroupRepositoryInterface::class,
|
||||||
function (Application $app, array $arguments) {
|
function (Application $app, array $arguments) {
|
||||||
if (!isset($arguments[0]) && $app->auth->check()) {
|
/** @var RuleGroupRepository $repository */
|
||||||
return app('FireflyIII\Repositories\RuleGroup\RuleGroupRepository', [auth()->user()]);
|
$repository = app(RuleGroupRepository::class);
|
||||||
}
|
if ($app->auth->check()) {
|
||||||
if (!isset($arguments[0]) && !$app->auth->check()) {
|
$repository->setUser(auth()->user());
|
||||||
throw new FireflyException('There is no user present.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return app('FireflyIII\Repositories\RuleGroup\RuleGroupRepository', $arguments);
|
return $repository;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user