Update files using Rector.

This commit is contained in:
James Cole
2025-05-29 15:01:06 +02:00
parent 189a323f3c
commit 5be6bb755d
126 changed files with 668 additions and 612 deletions

View File

@@ -59,8 +59,7 @@ class AccountServiceProvider extends ServiceProvider
private function registerRepository(): void
{
$this->app->bind(
AccountRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): AccountRepositoryInterface {
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepository::class);
@@ -74,8 +73,7 @@ class AccountServiceProvider extends ServiceProvider
);
$this->app->bind(
OperationsRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): OperationsRepositoryInterface {
/** @var OperationsRepository $repository */
$repository = app(OperationsRepository::class);
@@ -95,8 +93,7 @@ class AccountServiceProvider extends ServiceProvider
private function registerTasker(): void
{
$this->app->bind(
AccountTaskerInterface::class,
static function (Application $app) {
static function (Application $app): AccountTaskerInterface {
/** @var AccountTaskerInterface $tasker */
$tasker = app(AccountTasker::class);

View File

@@ -54,8 +54,7 @@ class AdminServiceProvider extends ServiceProvider
private function linkType(): void
{
$this->app->bind(
LinkTypeRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): LinkTypeRepositoryInterface {
/** @var LinkTypeRepository $repository */
$repository = app(LinkTypeRepository::class);
// reference to auth is not understood by phpstan.

View File

@@ -46,8 +46,7 @@ class AttachmentServiceProvider extends ServiceProvider
public function register(): void
{
$this->app->bind(
AttachmentRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): AttachmentRepositoryInterface {
/** @var AttachmentRepositoryInterface $repository */
$repository = app(AttachmentRepository::class);
// reference to auth is not understood by phpstan.

View File

@@ -46,8 +46,7 @@ class BillServiceProvider extends ServiceProvider
public function register(): void
{
$this->app->bind(
BillRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): BillRepositoryInterface {
/** @var BillRepositoryInterface $repository */
$repository = app(BillRepository::class);

View File

@@ -57,8 +57,7 @@ class BudgetServiceProvider extends ServiceProvider
{
// reference to auth is not understood by phpstan.
$this->app->bind(
BudgetRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): BudgetRepositoryInterface {
/** @var BudgetRepositoryInterface $repository */
$repository = app(BudgetRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line
@@ -71,8 +70,7 @@ class BudgetServiceProvider extends ServiceProvider
// available budget repos
$this->app->bind(
AvailableBudgetRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): AvailableBudgetRepositoryInterface {
/** @var AvailableBudgetRepositoryInterface $repository */
$repository = app(AvailableBudgetRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line
@@ -85,8 +83,7 @@ class BudgetServiceProvider extends ServiceProvider
// budget limit repository.
$this->app->bind(
BudgetLimitRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): BudgetLimitRepositoryInterface {
/** @var BudgetLimitRepositoryInterface $repository */
$repository = app(BudgetLimitRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line
@@ -99,8 +96,7 @@ class BudgetServiceProvider extends ServiceProvider
// no budget repos
$this->app->bind(
NoBudgetRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): NoBudgetRepositoryInterface {
/** @var NoBudgetRepositoryInterface $repository */
$repository = app(NoBudgetRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line
@@ -113,8 +109,7 @@ class BudgetServiceProvider extends ServiceProvider
// operations repos
$this->app->bind(
OperationsRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): OperationsRepositoryInterface {
/** @var OperationsRepositoryInterface $repository */
$repository = app(OperationsRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line

View File

@@ -51,8 +51,7 @@ class CategoryServiceProvider extends ServiceProvider
{
// phpstan does not understand reference to 'auth'.
$this->app->bind(
CategoryRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): CategoryRepositoryInterface {
/** @var CategoryRepository $repository */
$repository = app(CategoryRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line
@@ -64,8 +63,7 @@ class CategoryServiceProvider extends ServiceProvider
);
$this->app->bind(
OperationsRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): OperationsRepositoryInterface {
/** @var OperationsRepository $repository */
$repository = app(OperationsRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line
@@ -77,8 +75,7 @@ class CategoryServiceProvider extends ServiceProvider
);
$this->app->bind(
NoCategoryRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): NoCategoryRepositoryInterface {
/** @var NoCategoryRepository $repository */
$repository = app(NoCategoryRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line

View File

@@ -25,7 +25,6 @@ namespace FireflyIII\Providers;
use FireflyIII\Repositories\Currency\CurrencyRepository;
use FireflyIII\Repositories\Currency\CurrencyRepository as GroupCurrencyRepository;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface as GroupCurrencyRepositoryInterface;
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepository;
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
@@ -50,8 +49,7 @@ class CurrencyServiceProvider extends ServiceProvider
public function register(): void
{
$this->app->bind(
CurrencyRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): GroupCurrencyRepositoryInterface {
/** @var CurrencyRepository $repository */
$repository = app(CurrencyRepository::class);
// phpstan does not get the reference to auth
@@ -63,8 +61,7 @@ class CurrencyServiceProvider extends ServiceProvider
}
);
$this->app->bind(
GroupCurrencyRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): GroupCurrencyRepositoryInterface {
/** @var GroupCurrencyRepository $repository */
$repository = app(GroupCurrencyRepository::class);
// phpstan does not get the reference to auth
@@ -77,8 +74,7 @@ class CurrencyServiceProvider extends ServiceProvider
);
$this->app->bind(
ExchangeRateRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): ExchangeRateRepositoryInterface {
/** @var ExchangeRateRepository $repository */
$repository = app(ExchangeRateRepository::class);
// phpstan does not get the reference to auth

View File

@@ -163,8 +163,7 @@ class FireflyServiceProvider extends ServiceProvider
$this->app->bind(ALERepositoryInterface::class, ALERepository::class);
$this->app->bind(
ObjectGroupRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): ObjectGroupRepositoryInterface {
/** @var ObjectGroupRepository $repository */
$repository = app(ObjectGroupRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
@@ -176,8 +175,7 @@ class FireflyServiceProvider extends ServiceProvider
);
$this->app->bind(
WebhookRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): WebhookRepositoryInterface {
/** @var WebhookRepository $repository */
$repository = app(WebhookRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
@@ -190,8 +188,7 @@ class FireflyServiceProvider extends ServiceProvider
// rule expression language
$this->app->singleton(
ExpressionLanguage::class,
static function () {
static function (): ExpressionLanguage {
$expressionLanguage = new ExpressionLanguage();
$expressionLanguage->registerProvider(new ActionExpressionLanguageProvider());
@@ -200,8 +197,7 @@ class FireflyServiceProvider extends ServiceProvider
);
$this->app->bind(
RuleEngineInterface::class,
static function (Application $app) {
static function (Application $app): RuleEngineInterface {
/** @var SearchRuleEngine $engine */
$engine = app(SearchRuleEngine::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
@@ -213,8 +209,7 @@ class FireflyServiceProvider extends ServiceProvider
);
$this->app->bind(
UserGroupRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): UserGroupRepositoryInterface {
/** @var UserGroupRepository $repository */
$repository = app(UserGroupRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)

View File

@@ -64,8 +64,7 @@ class JournalServiceProvider extends ServiceProvider
private function registerRepository(): void
{
$this->app->bind(
JournalRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): JournalRepositoryInterface {
/** @var JournalRepositoryInterface $repository */
$repository = app(JournalRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
@@ -78,8 +77,7 @@ class JournalServiceProvider extends ServiceProvider
// also bind new API repository
$this->app->bind(
JournalAPIRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): JournalAPIRepositoryInterface {
/** @var JournalAPIRepositoryInterface $repository */
$repository = app(JournalAPIRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
@@ -92,8 +90,7 @@ class JournalServiceProvider extends ServiceProvider
// also bind new CLI repository
$this->app->bind(
JournalCLIRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): JournalCLIRepositoryInterface {
/** @var JournalCLIRepositoryInterface $repository */
$repository = app(JournalCLIRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
@@ -111,8 +108,7 @@ class JournalServiceProvider extends ServiceProvider
private function registerGroupRepository(): void
{
$this->app->bind(
TransactionGroupRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): TransactionGroupRepositoryInterface {
/** @var TransactionGroupRepositoryInterface $repository */
$repository = app(TransactionGroupRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
@@ -127,8 +123,7 @@ class JournalServiceProvider extends ServiceProvider
private function registerGroupCollector(): void
{
$this->app->bind(
GroupCollectorInterface::class,
static function (Application $app) {
static function (Application $app): GroupCollectorInterface {
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollector::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)

View File

@@ -46,8 +46,7 @@ class PiggyBankServiceProvider extends ServiceProvider
public function register(): void
{
$this->app->bind(
PiggyBankRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): PiggyBankRepositoryInterface {
/** @var PiggyBankRepository $repository */
$repository = app(PiggyBankRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)

View File

@@ -46,8 +46,7 @@ class RecurringServiceProvider extends ServiceProvider
public function register(): void
{
$this->app->bind(
RecurringRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): RecurringRepositoryInterface {
/** @var RecurringRepositoryInterface $repository */
$repository = app(RecurringRepository::class);

View File

@@ -46,8 +46,7 @@ class RuleGroupServiceProvider extends ServiceProvider
public function register(): void
{
$this->app->bind(
RuleGroupRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): RuleGroupRepositoryInterface {
/** @var RuleGroupRepository $repository */
$repository = app(RuleGroupRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)

View File

@@ -46,8 +46,7 @@ class RuleServiceProvider extends ServiceProvider
public function register(): void
{
$this->app->bind(
RuleRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): RuleRepositoryInterface {
/** @var RuleRepository $repository */
$repository = app(RuleRepository::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)

View File

@@ -49,8 +49,7 @@ class SearchServiceProvider extends ServiceProvider
public function register(): void
{
$this->app->bind(
QueryParserInterface::class,
static function (): GdbotsQueryParser|QueryParser {
static function (): QueryParserInterface {
$implementation = config('search.query_parser');
return match ($implementation) {
@@ -61,8 +60,7 @@ class SearchServiceProvider extends ServiceProvider
);
$this->app->bind(
SearchInterface::class,
static function (Application $app) {
static function (Application $app): SearchInterface {
/** @var OperatorQuerySearch $search */
$search = app(OperatorQuerySearch::class);
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)

View File

@@ -48,8 +48,7 @@ class TagServiceProvider extends ServiceProvider
public function register(): void
{
$this->app->bind(
TagRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): TagRepositoryInterface {
/** @var TagRepository $repository */
$repository = app(TagRepository::class);
@@ -62,8 +61,7 @@ class TagServiceProvider extends ServiceProvider
);
$this->app->bind(
OperationsRepositoryInterface::class,
static function (Application $app) {
static function (Application $app): OperationsRepositoryInterface {
/** @var OperationsRepository $repository */
$repository = app(OperationsRepository::class);