mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-22 20:16:22 +00:00 
			
		
		
		
	chore: code cleanup.
This commit is contained in:
		| @@ -58,6 +58,44 @@ class JournalServiceProvider extends ServiceProvider | ||||
|         $this->registerGroupCollector(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * | ||||
|      */ | ||||
|     private function registerGroupCollector(): void | ||||
|     { | ||||
|         $this->app->bind( | ||||
|             GroupCollectorInterface::class, | ||||
|             static function (Application $app) { | ||||
|                 /** @var GroupCollectorInterface $collector */ | ||||
|                 $collector = app(GroupCollector::class); | ||||
|                 if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) | ||||
|                     $collector->setUser(auth()->user()); | ||||
|                 } | ||||
|  | ||||
|                 return $collector; | ||||
|             } | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Register group repos. | ||||
|      */ | ||||
|     private function registerGroupRepository(): void | ||||
|     { | ||||
|         $this->app->bind( | ||||
|             TransactionGroupRepositoryInterface::class, | ||||
|             static function (Application $app) { | ||||
|                 /** @var TransactionGroupRepositoryInterface $repository */ | ||||
|                 $repository = app(TransactionGroupRepository::class); | ||||
|                 if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) | ||||
|                     $repository->setUser(auth()->user()); | ||||
|                 } | ||||
|  | ||||
|                 return $repository; | ||||
|             } | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Register repository. | ||||
|      */ | ||||
| @@ -104,42 +142,4 @@ class JournalServiceProvider extends ServiceProvider | ||||
|             } | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Register group repos. | ||||
|      */ | ||||
|     private function registerGroupRepository(): void | ||||
|     { | ||||
|         $this->app->bind( | ||||
|             TransactionGroupRepositoryInterface::class, | ||||
|             static function (Application $app) { | ||||
|                 /** @var TransactionGroupRepositoryInterface $repository */ | ||||
|                 $repository = app(TransactionGroupRepository::class); | ||||
|                 if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) | ||||
|                     $repository->setUser(auth()->user()); | ||||
|                 } | ||||
|  | ||||
|                 return $repository; | ||||
|             } | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * | ||||
|      */ | ||||
|     private function registerGroupCollector(): void | ||||
|     { | ||||
|         $this->app->bind( | ||||
|             GroupCollectorInterface::class, | ||||
|             static function (Application $app) { | ||||
|                 /** @var GroupCollectorInterface $collector */ | ||||
|                 $collector = app(GroupCollector::class); | ||||
|                 if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth) | ||||
|                     $collector->setUser(auth()->user()); | ||||
|                 } | ||||
|  | ||||
|                 return $collector; | ||||
|             } | ||||
|         ); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user