2015-02-06 20:43:19 +01:00
|
|
|
<?php
|
2016-05-20 12:41:23 +02:00
|
|
|
/**
|
|
|
|
* FireflyServiceProvider.php
|
|
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
|
|
|
*
|
2016-10-05 06:52:15 +02:00
|
|
|
* This software may be modified and distributed under the terms of the
|
|
|
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
|
|
|
*
|
|
|
|
* See the LICENSE file for details.
|
2016-05-20 12:41:23 +02:00
|
|
|
*/
|
|
|
|
|
2016-02-05 12:08:25 +01:00
|
|
|
declare(strict_types = 1);
|
2015-02-06 20:43:19 +01:00
|
|
|
|
|
|
|
namespace FireflyIII\Providers;
|
|
|
|
|
2015-02-11 07:35:10 +01:00
|
|
|
use FireflyIII\Support\Amount;
|
|
|
|
use FireflyIII\Support\ExpandedForm;
|
2016-07-24 18:47:55 +02:00
|
|
|
use FireflyIII\Support\FireflyConfig;
|
2015-02-11 07:35:10 +01:00
|
|
|
use FireflyIII\Support\Navigation;
|
|
|
|
use FireflyIII\Support\Preferences;
|
|
|
|
use FireflyIII\Support\Steam;
|
2015-05-01 22:44:35 +02:00
|
|
|
use FireflyIII\Support\Twig\General;
|
2015-05-02 11:32:45 +02:00
|
|
|
use FireflyIII\Support\Twig\Journal;
|
|
|
|
use FireflyIII\Support\Twig\PiggyBank;
|
2016-01-15 08:10:22 +01:00
|
|
|
use FireflyIII\Support\Twig\Rule;
|
2016-10-09 21:36:03 +02:00
|
|
|
use FireflyIII\Support\Twig\Transaction;
|
2016-10-10 07:49:55 +02:00
|
|
|
use FireflyIII\Support\Twig\Translation;
|
2015-02-11 07:35:10 +01:00
|
|
|
use FireflyIII\Validation\FireflyValidator;
|
2015-02-06 20:43:19 +01:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2015-05-01 08:29:41 +02:00
|
|
|
use Twig;
|
|
|
|
use TwigBridge\Extension\Loader\Functions;
|
2015-02-08 01:15:15 +01:00
|
|
|
use Validator;
|
2015-02-06 20:43:19 +01:00
|
|
|
|
2015-02-08 01:15:15 +01:00
|
|
|
/**
|
|
|
|
* Class FireflyServiceProvider
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Providers
|
|
|
|
*/
|
2015-02-06 20:43:19 +01:00
|
|
|
class FireflyServiceProvider extends ServiceProvider
|
|
|
|
{
|
2015-02-11 07:35:10 +01:00
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
Validator::resolver(
|
2015-06-06 23:09:12 +02:00
|
|
|
function ($translator, $data, $rules, $messages) {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new FireflyValidator($translator, $data, $rules, $messages);
|
|
|
|
}
|
|
|
|
);
|
2015-07-07 19:09:45 +02:00
|
|
|
$config = app('config');
|
2015-05-01 18:44:49 +02:00
|
|
|
Twig::addExtension(new Functions($config));
|
2015-05-02 11:32:45 +02:00
|
|
|
Twig::addExtension(new PiggyBank);
|
2015-05-01 22:44:35 +02:00
|
|
|
Twig::addExtension(new General);
|
2015-05-02 11:32:45 +02:00
|
|
|
Twig::addExtension(new Journal);
|
2015-05-09 22:42:45 +02:00
|
|
|
Twig::addExtension(new Translation);
|
2016-10-09 21:36:03 +02:00
|
|
|
Twig::addExtension(new Transaction);
|
2016-01-15 08:10:22 +01:00
|
|
|
Twig::addExtension(new Rule);
|
2015-02-08 01:15:15 +01:00
|
|
|
}
|
2015-02-11 07:35:10 +01:00
|
|
|
|
2015-05-17 10:30:18 +02:00
|
|
|
/**
|
2016-01-02 16:31:14 +01:00
|
|
|
*
|
2015-05-17 10:30:18 +02:00
|
|
|
*/
|
2015-02-06 20:43:19 +01:00
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
$this->app->bind(
|
2015-06-06 23:09:12 +02:00
|
|
|
'preferences', function () {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new Preferences;
|
2015-02-06 20:43:19 +01:00
|
|
|
}
|
|
|
|
);
|
2016-07-24 18:47:55 +02:00
|
|
|
|
|
|
|
$this->app->bind(
|
|
|
|
'fireflyconfig', function () {
|
|
|
|
return new FireflyConfig;
|
|
|
|
}
|
|
|
|
);
|
2015-02-06 21:23:14 +01:00
|
|
|
$this->app->bind(
|
2015-06-06 23:09:12 +02:00
|
|
|
'navigation', function () {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new Navigation;
|
2015-02-06 21:23:14 +01:00
|
|
|
}
|
|
|
|
);
|
2015-02-07 06:49:24 +01:00
|
|
|
$this->app->bind(
|
2015-06-06 23:09:12 +02:00
|
|
|
'amount', function () {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new Amount;
|
2015-02-07 06:49:24 +01:00
|
|
|
}
|
|
|
|
);
|
2015-02-07 08:23:44 +01:00
|
|
|
|
|
|
|
$this->app->bind(
|
2015-06-06 23:09:12 +02:00
|
|
|
'steam', function () {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new Steam;
|
2015-02-07 08:23:44 +01:00
|
|
|
}
|
|
|
|
);
|
2015-02-08 01:15:15 +01:00
|
|
|
$this->app->bind(
|
2015-06-06 23:09:12 +02:00
|
|
|
'expandedform', function () {
|
2015-02-11 07:35:10 +01:00
|
|
|
return new ExpandedForm;
|
2015-02-08 01:15:15 +01:00
|
|
|
}
|
|
|
|
);
|
2015-02-09 07:23:39 +01:00
|
|
|
|
2016-12-11 16:02:04 +01:00
|
|
|
// chart generator:
|
|
|
|
$this->app->bind('FireflyIII\Generator\Chart\Basic\GeneratorInterface', 'FireflyIII\Generator\Chart\Basic\ChartJsGenerator');
|
|
|
|
|
2016-12-11 16:25:46 +01:00
|
|
|
// other generators
|
2016-12-11 18:34:18 +01:00
|
|
|
$this->app->bind('FireflyIII\Export\ProcessorInterface', 'FireflyIII\Export\Processor');
|
2016-12-25 12:55:22 +01:00
|
|
|
$this->app->bind('FireflyIII\Import\ImportProcedureInterface', 'FireflyIII\Import\ImportProcedure');
|
2016-03-12 14:18:28 +01:00
|
|
|
$this->app->bind('FireflyIII\Repositories\User\UserRepositoryInterface', 'FireflyIII\Repositories\User\UserRepository');
|
2015-07-18 09:49:59 +02:00
|
|
|
$this->app->bind('FireflyIII\Helpers\Attachments\AttachmentHelperInterface', 'FireflyIII\Helpers\Attachments\AttachmentHelper');
|
2016-12-25 12:55:22 +01:00
|
|
|
|
2015-04-07 19:58:49 +02:00
|
|
|
$this->app->bind('FireflyIII\Helpers\Help\HelpInterface', 'FireflyIII\Helpers\Help\Help');
|
2015-02-23 20:25:48 +01:00
|
|
|
$this->app->bind('FireflyIII\Helpers\Report\ReportHelperInterface', 'FireflyIII\Helpers\Report\ReportHelper');
|
2016-01-27 11:54:04 +10:00
|
|
|
$this->app->bind('FireflyIII\Helpers\FiscalHelperInterface', 'FireflyIII\Helpers\FiscalHelper');
|
2016-01-27 21:35:59 +01:00
|
|
|
$this->app->bind('FireflyIII\Helpers\Report\BalanceReportHelperInterface', 'FireflyIII\Helpers\Report\BalanceReportHelper');
|
|
|
|
$this->app->bind('FireflyIII\Helpers\Report\BudgetReportHelperInterface', 'FireflyIII\Helpers\Report\BudgetReportHelper');
|
2015-02-06 20:43:19 +01:00
|
|
|
}
|
|
|
|
|
2015-03-29 08:14:32 +02:00
|
|
|
}
|