| 
									
										
										
										
											2015-02-06 20:43:19 +01:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2022-12-29 19:42:26 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-20 12:41:23 +02:00
										 |  |  | /** | 
					
						
							|  |  |  |  * FireflyServiceProvider.php | 
					
						
							| 
									
										
										
										
											2020-02-16 13:55:52 +01:00
										 |  |  |  * Copyright (c) 2019 james@firefly-iii.org | 
					
						
							| 
									
										
										
										
											2016-05-20 12:41:23 +02:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-10-02 06:37:26 +02:00
										 |  |  |  * This file is part of Firefly III (https://github.com/firefly-iii). | 
					
						
							| 
									
										
										
										
											2016-10-05 06:52:15 +02:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-10-02 06:37:26 +02:00
										 |  |  |  * This program is free software: you can redistribute it and/or modify | 
					
						
							|  |  |  |  * it under the terms of the GNU Affero General Public License as | 
					
						
							|  |  |  |  * published by the Free Software Foundation, either version 3 of the | 
					
						
							|  |  |  |  * License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2017-10-21 08:40:00 +02:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-10-02 06:37:26 +02:00
										 |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							| 
									
										
										
										
											2017-10-21 08:40:00 +02:00
										 |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							| 
									
										
										
										
											2019-10-02 06:37:26 +02:00
										 |  |  |  * GNU Affero General Public License for more details. | 
					
						
							| 
									
										
										
										
											2017-10-21 08:40:00 +02:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-10-02 06:37:26 +02:00
										 |  |  |  * You should have received a copy of the GNU Affero General Public License | 
					
						
							|  |  |  |  * along with this program.  If not, see <https://www.gnu.org/licenses/>. | 
					
						
							| 
									
										
										
										
											2016-05-20 12:41:23 +02:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2017-03-29 21:20:54 +02:00
										 |  |  | declare(strict_types=1); | 
					
						
							| 
									
										
										
										
											2015-02-06 20:43:19 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace FireflyIII\Providers; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-02 07:35:53 +01:00
										 |  |  | use FireflyIII\Generator\Chart\Basic\ChartJsGenerator; | 
					
						
							|  |  |  | use FireflyIII\Generator\Chart\Basic\GeneratorInterface; | 
					
						
							| 
									
										
										
										
											2020-12-05 06:47:16 +01:00
										 |  |  | use FireflyIII\Generator\Webhook\MessageGeneratorInterface; | 
					
						
							|  |  |  | use FireflyIII\Generator\Webhook\StandardMessageGenerator; | 
					
						
							| 
									
										
										
										
											2017-02-02 07:35:53 +01:00
										 |  |  | use FireflyIII\Helpers\Attachments\AttachmentHelper; | 
					
						
							|  |  |  | use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; | 
					
						
							| 
									
										
										
										
											2019-06-21 19:10:02 +02:00
										 |  |  | use FireflyIII\Helpers\Fiscal\FiscalHelper; | 
					
						
							|  |  |  | use FireflyIII\Helpers\Fiscal\FiscalHelperInterface; | 
					
						
							| 
									
										
										
										
											2018-08-26 18:40:38 +02:00
										 |  |  | use FireflyIII\Helpers\Report\NetWorth; | 
					
						
							|  |  |  | use FireflyIII\Helpers\Report\NetWorthInterface; | 
					
						
							| 
									
										
										
										
											2017-03-29 21:20:54 +02:00
										 |  |  | use FireflyIII\Helpers\Report\PopupReport; | 
					
						
							|  |  |  | use FireflyIII\Helpers\Report\PopupReportInterface; | 
					
						
							| 
									
										
										
										
											2017-02-02 07:35:53 +01:00
										 |  |  | use FireflyIII\Helpers\Report\ReportHelper; | 
					
						
							|  |  |  | use FireflyIII\Helpers\Report\ReportHelperInterface; | 
					
						
							| 
									
										
										
										
											2020-12-04 20:19:52 +01:00
										 |  |  | use FireflyIII\Helpers\Webhook\Sha3SignatureGenerator; | 
					
						
							|  |  |  | use FireflyIII\Helpers\Webhook\SignatureGeneratorInterface; | 
					
						
							| 
									
										
										
										
											2022-10-02 14:37:50 +02:00
										 |  |  | use FireflyIII\Repositories\AuditLogEntry\ALERepository; | 
					
						
							|  |  |  | use FireflyIII\Repositories\AuditLogEntry\ALERepositoryInterface; | 
					
						
							| 
									
										
										
										
											2020-06-07 11:31:01 +02:00
										 |  |  | use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepository; | 
					
						
							|  |  |  | use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface; | 
					
						
							| 
									
										
										
										
											2019-03-08 05:47:51 +01:00
										 |  |  | use FireflyIII\Repositories\TransactionType\TransactionTypeRepository; | 
					
						
							|  |  |  | use FireflyIII\Repositories\TransactionType\TransactionTypeRepositoryInterface; | 
					
						
							| 
									
										
										
										
											2017-02-02 07:35:53 +01:00
										 |  |  | use FireflyIII\Repositories\User\UserRepository; | 
					
						
							|  |  |  | use FireflyIII\Repositories\User\UserRepositoryInterface; | 
					
						
							| 
									
										
										
										
											2023-09-20 06:17:56 +02:00
										 |  |  | use FireflyIII\Repositories\UserGroup\UserGroupRepository; | 
					
						
							|  |  |  | use FireflyIII\Repositories\UserGroup\UserGroupRepositoryInterface; | 
					
						
							| 
									
										
										
										
											2020-11-29 18:35:49 +01:00
										 |  |  | use FireflyIII\Repositories\Webhook\WebhookRepository; | 
					
						
							|  |  |  | use FireflyIII\Repositories\Webhook\WebhookRepositoryInterface; | 
					
						
							| 
									
										
										
										
											2019-10-26 14:42:51 +02:00
										 |  |  | use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequest; | 
					
						
							|  |  |  | use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequestInterface; | 
					
						
							| 
									
										
										
										
											2020-04-11 06:42:40 +02:00
										 |  |  | use FireflyIII\Services\Password\PwndVerifierV2; | 
					
						
							| 
									
										
										
										
											2017-08-04 15:48:26 +02:00
										 |  |  | use FireflyIII\Services\Password\Verifier; | 
					
						
							| 
									
										
										
										
											2020-12-04 20:19:52 +01:00
										 |  |  | use FireflyIII\Services\Webhook\StandardWebhookSender; | 
					
						
							|  |  |  | use FireflyIII\Services\Webhook\WebhookSenderInterface; | 
					
						
							| 
									
										
										
										
											2015-02-11 07:35:10 +01:00
										 |  |  | use FireflyIII\Support\Amount; | 
					
						
							| 
									
										
										
										
											2024-07-31 20:19:17 +02:00
										 |  |  | use FireflyIII\Support\Balance; | 
					
						
							| 
									
										
										
										
											2019-08-10 16:50:37 +02:00
										 |  |  | use FireflyIII\Support\ExpandedForm; | 
					
						
							| 
									
										
										
										
											2019-08-17 10:47:29 +02:00
										 |  |  | use FireflyIII\Support\FireflyConfig; | 
					
						
							| 
									
										
										
										
											2019-08-10 15:09:44 +02:00
										 |  |  | use FireflyIII\Support\Form\AccountForm; | 
					
						
							| 
									
										
										
										
											2019-08-10 16:50:37 +02:00
										 |  |  | use FireflyIII\Support\Form\CurrencyForm; | 
					
						
							|  |  |  | use FireflyIII\Support\Form\PiggyBankForm; | 
					
						
							|  |  |  | use FireflyIII\Support\Form\RuleForm; | 
					
						
							| 
									
										
										
										
											2015-02-11 07:35:10 +01:00
										 |  |  | use FireflyIII\Support\Navigation; | 
					
						
							|  |  |  | use FireflyIII\Support\Preferences; | 
					
						
							|  |  |  | use FireflyIII\Support\Steam; | 
					
						
							| 
									
										
										
										
											2020-08-22 16:55:54 +02:00
										 |  |  | use FireflyIII\TransactionRules\Engine\RuleEngineInterface; | 
					
						
							|  |  |  | use FireflyIII\TransactionRules\Engine\SearchRuleEngine; | 
					
						
							| 
									
										
										
										
											2024-03-07 13:00:57 -05:00
										 |  |  | use FireflyIII\TransactionRules\Expressions\ActionExpressionLanguageProvider; | 
					
						
							| 
									
										
										
										
											2015-02-11 07:35:10 +01:00
										 |  |  | use FireflyIII\Validation\FireflyValidator; | 
					
						
							| 
									
										
										
										
											2020-06-20 10:22:07 +02:00
										 |  |  | use Illuminate\Foundation\Application; | 
					
						
							| 
									
										
										
										
											2015-02-06 20:43:19 +01:00
										 |  |  | use Illuminate\Support\ServiceProvider; | 
					
						
							| 
									
										
										
										
											2024-03-07 13:00:57 -05:00
										 |  |  | use Symfony\Component\ExpressionLanguage\ExpressionLanguage; | 
					
						
							| 
									
										
										
										
											2015-02-06 20:43:19 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-08 01:15:15 +01:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2017-11-15 12:25:49 +01:00
										 |  |  |  * Class FireflyServiceProvider. | 
					
						
							| 
									
										
										
										
											2023-12-22 20:12:38 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2025-01-03 18:16:27 +01:00
										 |  |  |  * @SuppressWarnings("PHPMD.CouplingBetweenObjects") | 
					
						
							| 
									
										
										
										
											2015-02-08 01:15:15 +01:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2015-02-06 20:43:19 +01:00
										 |  |  | class FireflyServiceProvider extends ServiceProvider | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-22 18:32:43 +01:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Start provider. | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2018-07-22 18:50:27 +02:00
										 |  |  |     public function boot(): void | 
					
						
							| 
									
										
										
										
											2015-02-11 07:35:10 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2023-12-20 19:35:52 +01:00
										 |  |  |         \Validator::resolver( | 
					
						
							| 
									
										
										
										
											2019-12-28 09:44:56 +01:00
										 |  |  |             static function ($translator, $data, $rules, $messages) { | 
					
						
							| 
									
										
										
										
											2015-02-11 07:35:10 +01:00
										 |  |  |                 return new FireflyValidator($translator, $data, $rules, $messages); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							| 
									
										
										
										
											2015-02-08 01:15:15 +01:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-02-11 07:35:10 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-17 10:30:18 +02:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2017-12-22 18:32:43 +01:00
										 |  |  |      * Register stuff. | 
					
						
							| 
									
										
										
										
											2023-12-21 06:06:23 +01:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2025-01-03 15:53:10 +01:00
										 |  |  |      * @SuppressWarnings("PHPMD.ExcessiveMethodLength") | 
					
						
							| 
									
										
										
										
											2015-05-17 10:30:18 +02:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2018-07-22 18:50:27 +02:00
										 |  |  |     public function register(): void | 
					
						
							| 
									
										
										
										
											2015-02-06 20:43:19 +01:00
										 |  |  |     { | 
					
						
							|  |  |  |         $this->app->bind( | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             'preferences', | 
					
						
							| 
									
										
										
										
											2020-03-13 08:02:38 +01:00
										 |  |  |             static function () { | 
					
						
							| 
									
										
										
										
											2022-10-30 14:24:28 +01:00
										 |  |  |                 return new Preferences(); | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2015-02-06 20:43:19 +01:00
										 |  |  |         ); | 
					
						
							| 
									
										
										
										
											2016-07-24 18:47:55 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         $this->app->bind( | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             'fireflyconfig', | 
					
						
							| 
									
										
										
										
											2020-03-13 08:02:38 +01:00
										 |  |  |             static function () { | 
					
						
							| 
									
										
										
										
											2022-10-30 14:24:28 +01:00
										 |  |  |                 return new FireflyConfig(); | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2016-07-24 18:47:55 +02:00
										 |  |  |         ); | 
					
						
							| 
									
										
										
										
											2015-02-06 21:23:14 +01:00
										 |  |  |         $this->app->bind( | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             'navigation', | 
					
						
							| 
									
										
										
										
											2020-03-13 08:02:38 +01:00
										 |  |  |             static function () { | 
					
						
							| 
									
										
										
										
											2022-10-30 14:24:28 +01:00
										 |  |  |                 return new Navigation(); | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2015-02-06 21:23:14 +01:00
										 |  |  |         ); | 
					
						
							| 
									
										
										
										
											2015-02-07 06:49:24 +01:00
										 |  |  |         $this->app->bind( | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             'amount', | 
					
						
							| 
									
										
										
										
											2020-03-13 08:02:38 +01:00
										 |  |  |             static function () { | 
					
						
							| 
									
										
										
										
											2022-10-30 14:24:28 +01:00
										 |  |  |                 return new Amount(); | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2015-02-07 06:49:24 +01:00
										 |  |  |         ); | 
					
						
							| 
									
										
										
										
											2015-02-07 08:23:44 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         $this->app->bind( | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             'steam', | 
					
						
							| 
									
										
										
										
											2020-03-13 08:02:38 +01:00
										 |  |  |             static function () { | 
					
						
							| 
									
										
										
										
											2022-10-30 14:24:28 +01:00
										 |  |  |                 return new Steam(); | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2015-02-07 08:23:44 +01:00
										 |  |  |         ); | 
					
						
							| 
									
										
										
										
											2024-07-31 20:19:17 +02:00
										 |  |  |         $this->app->bind( | 
					
						
							|  |  |  |             'balance', | 
					
						
							|  |  |  |             static function () { | 
					
						
							|  |  |  |                 return new Balance(); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							| 
									
										
										
										
											2015-02-08 01:15:15 +01:00
										 |  |  |         $this->app->bind( | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             'expandedform', | 
					
						
							| 
									
										
										
										
											2019-08-10 16:50:37 +02:00
										 |  |  |             static function () { | 
					
						
							| 
									
										
										
										
											2022-10-30 14:24:28 +01:00
										 |  |  |                 return new ExpandedForm(); | 
					
						
							| 
									
										
										
										
											2017-11-15 10:52:29 +01:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2015-02-08 01:15:15 +01:00
										 |  |  |         ); | 
					
						
							| 
									
										
										
										
											2015-02-09 07:23:39 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-10 15:09:44 +02:00
										 |  |  |         $this->app->bind( | 
					
						
							|  |  |  |             'accountform', | 
					
						
							|  |  |  |             static function () { | 
					
						
							| 
									
										
										
										
											2022-10-30 14:24:28 +01:00
										 |  |  |                 return new AccountForm(); | 
					
						
							| 
									
										
										
										
											2019-08-10 15:09:44 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							| 
									
										
										
										
											2019-08-10 16:50:37 +02:00
										 |  |  |         $this->app->bind( | 
					
						
							|  |  |  |             'currencyform', | 
					
						
							|  |  |  |             static function () { | 
					
						
							| 
									
										
										
										
											2022-10-30 14:24:28 +01:00
										 |  |  |                 return new CurrencyForm(); | 
					
						
							| 
									
										
										
										
											2019-08-10 16:50:37 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $this->app->bind( | 
					
						
							|  |  |  |             'piggybankform', | 
					
						
							|  |  |  |             static function () { | 
					
						
							| 
									
										
										
										
											2022-10-30 14:24:28 +01:00
										 |  |  |                 return new PiggyBankForm(); | 
					
						
							| 
									
										
										
										
											2019-08-10 16:50:37 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $this->app->bind( | 
					
						
							|  |  |  |             'ruleform', | 
					
						
							|  |  |  |             static function () { | 
					
						
							| 
									
										
										
										
											2022-10-30 14:24:28 +01:00
										 |  |  |                 return new RuleForm(); | 
					
						
							| 
									
										
										
										
											2019-08-10 16:50:37 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							| 
									
										
										
										
											2019-08-10 15:09:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-11 16:02:04 +01:00
										 |  |  |         // chart generator:
 | 
					
						
							| 
									
										
										
										
											2017-02-02 07:35:53 +01:00
										 |  |  |         $this->app->bind(GeneratorInterface::class, ChartJsGenerator::class); | 
					
						
							| 
									
										
										
										
											2016-12-11 16:25:46 +01:00
										 |  |  |         // other generators
 | 
					
						
							| 
									
										
										
										
											2017-02-02 07:35:53 +01:00
										 |  |  |         $this->app->bind(UserRepositoryInterface::class, UserRepository::class); | 
					
						
							| 
									
										
										
										
											2019-03-08 05:47:51 +01:00
										 |  |  |         $this->app->bind(TransactionTypeRepositoryInterface::class, TransactionTypeRepository::class); | 
					
						
							| 
									
										
										
										
											2020-06-20 10:22:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-02 07:35:53 +01:00
										 |  |  |         $this->app->bind(AttachmentHelperInterface::class, AttachmentHelper::class); | 
					
						
							| 
									
										
										
										
											2022-10-02 14:37:50 +02:00
										 |  |  |         $this->app->bind(ALERepositoryInterface::class, ALERepository::class); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-20 10:22:07 +02:00
										 |  |  |         $this->app->bind( | 
					
						
							|  |  |  |             ObjectGroupRepositoryInterface::class, | 
					
						
							|  |  |  |             static function (Application $app) { | 
					
						
							|  |  |  |                 /** @var ObjectGroupRepository $repository */ | 
					
						
							|  |  |  |                 $repository = app(ObjectGroupRepository::class); | 
					
						
							| 
									
										
										
										
											2022-12-31 13:32:42 +01:00
										 |  |  |                 if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
 | 
					
						
							| 
									
										
										
										
											2020-06-20 10:22:07 +02:00
										 |  |  |                     $repository->setUser(auth()->user()); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 return $repository; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-29 18:35:49 +01:00
										 |  |  |         $this->app->bind( | 
					
						
							|  |  |  |             WebhookRepositoryInterface::class, | 
					
						
							|  |  |  |             static function (Application $app) { | 
					
						
							|  |  |  |                 /** @var WebhookRepository $repository */ | 
					
						
							|  |  |  |                 $repository = app(WebhookRepository::class); | 
					
						
							| 
									
										
										
										
											2022-12-31 13:32:42 +01:00
										 |  |  |                 if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
 | 
					
						
							| 
									
										
										
										
											2020-11-29 18:35:49 +01:00
										 |  |  |                     $repository->setUser(auth()->user()); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 return $repository; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-07 13:00:57 -05:00
										 |  |  |         // rule expression language
 | 
					
						
							|  |  |  |         $this->app->singleton( | 
					
						
							|  |  |  |             ExpressionLanguage::class, | 
					
						
							|  |  |  |             static function () { | 
					
						
							|  |  |  |                 $expressionLanguage = new ExpressionLanguage(); | 
					
						
							|  |  |  |                 $expressionLanguage->registerProvider(new ActionExpressionLanguageProvider()); | 
					
						
							| 
									
										
										
										
											2024-03-10 06:17:31 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-07 13:00:57 -05:00
										 |  |  |                 return $expressionLanguage; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-22 16:55:54 +02:00
										 |  |  |         $this->app->bind( | 
					
						
							|  |  |  |             RuleEngineInterface::class, | 
					
						
							|  |  |  |             static function (Application $app) { | 
					
						
							|  |  |  |                 /** @var SearchRuleEngine $engine */ | 
					
						
							|  |  |  |                 $engine = app(SearchRuleEngine::class); | 
					
						
							| 
									
										
										
										
											2022-12-31 13:32:42 +01:00
										 |  |  |                 if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
 | 
					
						
							| 
									
										
										
										
											2020-08-22 16:55:54 +02:00
										 |  |  |                     $engine->setUser(auth()->user()); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 return $engine; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-20 06:17:56 +02:00
										 |  |  |         $this->app->bind( | 
					
						
							|  |  |  |             UserGroupRepositoryInterface::class, | 
					
						
							|  |  |  |             static function (Application $app) { | 
					
						
							|  |  |  |                 /** @var UserGroupRepository $repository */ | 
					
						
							|  |  |  |                 $repository = app(UserGroupRepository::class); | 
					
						
							|  |  |  |                 if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
 | 
					
						
							|  |  |  |                     $repository->setUser(auth()->user()); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 return $repository; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-29 21:20:54 +02:00
										 |  |  |         // more generators:
 | 
					
						
							|  |  |  |         $this->app->bind(PopupReportInterface::class, PopupReport::class); | 
					
						
							| 
									
										
										
										
											2017-02-02 07:35:53 +01:00
										 |  |  |         $this->app->bind(ReportHelperInterface::class, ReportHelper::class); | 
					
						
							| 
									
										
										
										
											2017-02-17 06:42:36 +01:00
										 |  |  |         $this->app->bind(FiscalHelperInterface::class, FiscalHelper::class); | 
					
						
							| 
									
										
										
										
											2019-10-26 14:42:51 +02:00
										 |  |  |         $this->app->bind(UpdateRequestInterface::class, UpdateRequest::class); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-04 20:19:52 +01:00
										 |  |  |         // webhooks:
 | 
					
						
							| 
									
										
										
										
											2020-12-05 06:47:16 +01:00
										 |  |  |         $this->app->bind(MessageGeneratorInterface::class, StandardMessageGenerator::class); | 
					
						
							| 
									
										
										
										
											2021-03-21 09:15:40 +01:00
										 |  |  |         $this->app->bind(SignatureGeneratorInterface::class, Sha3SignatureGenerator::class); | 
					
						
							| 
									
										
										
										
											2020-12-04 20:19:52 +01:00
										 |  |  |         $this->app->bind(WebhookSenderInterface::class, StandardWebhookSender::class); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-04 15:46:52 +02:00
										 |  |  |         // password verifier thing
 | 
					
						
							| 
									
										
										
										
											2020-04-11 06:42:40 +02:00
										 |  |  |         $this->app->bind(Verifier::class, PwndVerifierV2::class); | 
					
						
							| 
									
										
										
										
											2018-04-10 21:18:38 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-26 18:40:38 +02:00
										 |  |  |         // net worth thing.
 | 
					
						
							|  |  |  |         $this->app->bind(NetWorthInterface::class, NetWorth::class); | 
					
						
							| 
									
										
										
										
											2015-02-06 20:43:19 +01:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-03-29 08:14:32 +02:00
										 |  |  | } |