From 7bf7bb529ec380bc9d69c88e38af977fa0e1c57c Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 20 Sep 2023 06:36:43 +0200 Subject: [PATCH] Various code cleanup --- .ci/php-cs-fixer/composer.lock | 12 ++--- .../Controllers/Chart/BalanceController.php | 5 +- .../V2/Controllers/Chart/BudgetController.php | 4 +- .../Controllers/Chart/CategoryController.php | 6 ++- .../Controllers/Model/Bill/ShowController.php | 4 +- .../Model/PiggyBank/ShowController.php | 4 +- .../Model/Transaction/StoreController.php | 4 +- .../UserGroup/DestroyController.php | 5 +- .../Controllers/UserGroup/ShowController.php | 4 ++ .../Controllers/UserGroup/StoreController.php | 6 +++ .../UserGroup/UpdateController.php | 8 ++- .../V2/Request/Chart/BalanceChartRequest.php | 7 ++- app/Api/V2/Request/UserGroup/StoreRequest.php | 7 +++ app/Console/Commands/System/OutputVersion.php | 20 +++++--- .../Model/Rule/RuleActionFailedOnArray.php | 4 +- .../Model/Rule/RuleActionFailedOnObject.php | 6 ++- app/Factory/UserGroupFactory.php | 4 ++ app/Handlers/Events/Model/RuleHandler.php | 4 +- app/Models/Rule.php | 18 +++---- app/Models/TransactionGroup.php | 18 +++---- app/Notifications/User/UserLogin.php | 1 - .../Administration/Bill/BillRepository.php | 4 +- .../Bill/BillRepositoryInterface.php | 4 +- .../Budget/AvailableBudgetRepository.php | 5 +- .../AvailableBudgetRepositoryInterface.php | 5 +- .../Budget/BudgetRepository.php | 5 +- .../Budget/BudgetRepositoryInterface.php | 5 +- .../Budget/OperationsRepository.php | 5 +- .../Budget/OperationsRepositoryInterface.php | 9 ++-- .../PiggyBank/PiggyBankRepository.php | 5 +- .../PiggyBankRepositoryInterface.php | 4 +- .../UserGroup/UserGroupRepository.php | 4 ++ .../UserGroupRepositoryInterface.php | 4 ++ app/Support/Http/Api/CleansChartData.php | 4 +- .../Http/Api/ExchangeRateConverter.php | 4 +- app/Support/Notifications/UrlValidator.php | 4 +- app/Transformers/V2/BillTransformer.php | 5 +- app/Transformers/V2/UserGroupTransformer.php | 4 ++ app/User.php | 49 ++++++++++++------- artisan | 4 +- config/cors.php | 21 ++++++++ config/hashing.php | 21 ++++++++ .../2023_08_11_192521_upgrade_og_table.php | 21 ++++++++ public/v3/index.html | 22 ++++++++- resources/assets/v2/pages/shared/dates.js | 20 ++++++++ resources/assets/v2/support/get-viewrange.js | 20 ++++++++ resources/lang/en_US/rules.php | 3 +- vite.config.js | 20 ++++++++ 48 files changed, 348 insertions(+), 84 deletions(-) diff --git a/.ci/php-cs-fixer/composer.lock b/.ci/php-cs-fixer/composer.lock index 94cac8ac65..c7661887d2 100644 --- a/.ci/php-cs-fixer/composer.lock +++ b/.ci/php-cs-fixer/composer.lock @@ -226,16 +226,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.26.1", + "version": "v3.27.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "d023ba6684055f6ea1da1352d8a02baca0426983" + "reference": "e73ccaae1208f017bb7860986eebb3da48bd25d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d023ba6684055f6ea1da1352d8a02baca0426983", - "reference": "d023ba6684055f6ea1da1352d8a02baca0426983", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e73ccaae1208f017bb7860986eebb3da48bd25d6", + "reference": "e73ccaae1208f017bb7860986eebb3da48bd25d6", "shasum": "" }, "require": { @@ -309,7 +309,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.26.1" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.27.0" }, "funding": [ { @@ -317,7 +317,7 @@ "type": "github" } ], - "time": "2023-09-08T19:09:07+00:00" + "time": "2023-09-17T14:37:54+00:00" }, { "name": "psr/container", diff --git a/app/Api/V2/Controllers/Chart/BalanceController.php b/app/Api/V2/Controllers/Chart/BalanceController.php index ea94b4821c..0435242d94 100644 --- a/app/Api/V2/Controllers/Chart/BalanceController.php +++ b/app/Api/V2/Controllers/Chart/BalanceController.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + + namespace FireflyIII\Api\V2\Controllers\Chart; use Carbon\Carbon; diff --git a/app/Api/V2/Controllers/Chart/BudgetController.php b/app/Api/V2/Controllers/Chart/BudgetController.php index d3c22a813e..ea8f9609fe 100644 --- a/app/Api/V2/Controllers/Chart/BudgetController.php +++ b/app/Api/V2/Controllers/Chart/BudgetController.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Controllers\Chart; use Carbon\Carbon; diff --git a/app/Api/V2/Controllers/Chart/CategoryController.php b/app/Api/V2/Controllers/Chart/CategoryController.php index dc43bb284f..bece4e2bd1 100644 --- a/app/Api/V2/Controllers/Chart/CategoryController.php +++ b/app/Api/V2/Controllers/Chart/CategoryController.php @@ -1,8 +1,8 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Controllers\Chart; use Carbon\Carbon; diff --git a/app/Api/V2/Controllers/Model/Bill/ShowController.php b/app/Api/V2/Controllers/Model/Bill/ShowController.php index 3f0cb7c5db..fc9829acbc 100644 --- a/app/Api/V2/Controllers/Model/Bill/ShowController.php +++ b/app/Api/V2/Controllers/Model/Bill/ShowController.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Controllers\Model\Bill; use FireflyIII\Api\V2\Controllers\Controller; diff --git a/app/Api/V2/Controllers/Model/PiggyBank/ShowController.php b/app/Api/V2/Controllers/Model/PiggyBank/ShowController.php index 3080ef3b17..ed6b0846e9 100644 --- a/app/Api/V2/Controllers/Model/PiggyBank/ShowController.php +++ b/app/Api/V2/Controllers/Model/PiggyBank/ShowController.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Controllers\Model\PiggyBank; use FireflyIII\Api\V2\Controllers\Controller; diff --git a/app/Api/V2/Controllers/Model/Transaction/StoreController.php b/app/Api/V2/Controllers/Model/Transaction/StoreController.php index 91567dd1a3..20e76ed300 100644 --- a/app/Api/V2/Controllers/Model/Transaction/StoreController.php +++ b/app/Api/V2/Controllers/Model/Transaction/StoreController.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Controllers\Model\Transaction; use FireflyIII\Api\V2\Controllers\Controller; diff --git a/app/Api/V2/Controllers/UserGroup/DestroyController.php b/app/Api/V2/Controllers/UserGroup/DestroyController.php index 5860ccc255..27254ace92 100644 --- a/app/Api/V2/Controllers/UserGroup/DestroyController.php +++ b/app/Api/V2/Controllers/UserGroup/DestroyController.php @@ -1,4 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Controllers\UserGroup; use FireflyIII\Api\V2\Controllers\Controller; @@ -28,5 +32,4 @@ use FireflyIII\Api\V2\Controllers\Controller; */ class DestroyController extends Controller { - } diff --git a/app/Api/V2/Controllers/UserGroup/ShowController.php b/app/Api/V2/Controllers/UserGroup/ShowController.php index f254672d7b..afd87d4706 100644 --- a/app/Api/V2/Controllers/UserGroup/ShowController.php +++ b/app/Api/V2/Controllers/UserGroup/ShowController.php @@ -1,4 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Controllers\UserGroup; use FireflyIII\Api\V2\Controllers\Controller; diff --git a/app/Api/V2/Controllers/UserGroup/StoreController.php b/app/Api/V2/Controllers/UserGroup/StoreController.php index 678e1946d0..4e74ab7c75 100644 --- a/app/Api/V2/Controllers/UserGroup/StoreController.php +++ b/app/Api/V2/Controllers/UserGroup/StoreController.php @@ -1,4 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Controllers\UserGroup; use FireflyIII\Api\V2\Controllers\Controller; @@ -50,6 +54,8 @@ class StoreController extends Controller } /** + * @param StoreRequest $request + * * @return JsonResponse */ public function store(StoreRequest $request): JsonResponse diff --git a/app/Api/V2/Controllers/UserGroup/UpdateController.php b/app/Api/V2/Controllers/UserGroup/UpdateController.php index 97313b03ee..2daa1f84d5 100644 --- a/app/Api/V2/Controllers/UserGroup/UpdateController.php +++ b/app/Api/V2/Controllers/UserGroup/UpdateController.php @@ -1,4 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Controllers\UserGroup; use FireflyIII\Api\V2\Controllers\Controller; +/** + * Class UpdateController + */ class UpdateController extends Controller { - // basic edit van group // add user, add rights, remove user, remove rights. } diff --git a/app/Api/V2/Request/Chart/BalanceChartRequest.php b/app/Api/V2/Request/Chart/BalanceChartRequest.php index c9c0087f06..4ce50da02e 100644 --- a/app/Api/V2/Request/Chart/BalanceChartRequest.php +++ b/app/Api/V2/Request/Chart/BalanceChartRequest.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Request\Chart; use FireflyIII\Support\Request\ChecksLogin; @@ -28,6 +30,9 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Validator; +/** + * Class BalanceChartRequest + */ class BalanceChartRequest extends FormRequest { use ConvertsDataTypes; diff --git a/app/Api/V2/Request/UserGroup/StoreRequest.php b/app/Api/V2/Request/UserGroup/StoreRequest.php index 44a9db247a..494417cbf5 100644 --- a/app/Api/V2/Request/UserGroup/StoreRequest.php +++ b/app/Api/V2/Request/UserGroup/StoreRequest.php @@ -1,4 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Api\V2\Request\UserGroup; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; +/** + * Class StoreRequest + */ class StoreRequest extends FormRequest { use ChecksLogin; diff --git a/app/Console/Commands/System/OutputVersion.php b/app/Console/Commands/System/OutputVersion.php index 7f49a54623..eea501b031 100644 --- a/app/Console/Commands/System/OutputVersion.php +++ b/app/Console/Commands/System/OutputVersion.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Console\Commands\System; use Illuminate\Console\Command; +/** + * Class OutputVersion + */ class OutputVersion extends Command { - /** - * The name and signature of the console command. - * - * @var string - */ - protected $signature = 'firefly-iii:output-version'; - /** * The console command description. * * @var string */ protected $description = 'Outputs the Firefly III version'; + /** + * The name and signature of the console command. + * + * @var string + */ + protected $signature = 'firefly-iii:output-version'; /** * Execute the console command. diff --git a/app/Events/Model/Rule/RuleActionFailedOnArray.php b/app/Events/Model/Rule/RuleActionFailedOnArray.php index dc7cc0cb55..fe11bf9a0b 100644 --- a/app/Events/Model/Rule/RuleActionFailedOnArray.php +++ b/app/Events/Model/Rule/RuleActionFailedOnArray.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Events\Model\Rule; use FireflyIII\Models\RuleAction; diff --git a/app/Events/Model/Rule/RuleActionFailedOnObject.php b/app/Events/Model/Rule/RuleActionFailedOnObject.php index ffb8d45da9..a9df1869ee 100644 --- a/app/Events/Model/Rule/RuleActionFailedOnObject.php +++ b/app/Events/Model/Rule/RuleActionFailedOnObject.php @@ -1,8 +1,8 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Events\Model\Rule; use FireflyIII\Models\RuleAction; diff --git a/app/Factory/UserGroupFactory.php b/app/Factory/UserGroupFactory.php index 18be0bc917..f4d3169772 100644 --- a/app/Factory/UserGroupFactory.php +++ b/app/Factory/UserGroupFactory.php @@ -1,4 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Factory; use FireflyIII\Enums\UserRoleEnum; diff --git a/app/Handlers/Events/Model/RuleHandler.php b/app/Handlers/Events/Model/RuleHandler.php index 933c08b0eb..99f9aa208b 100644 --- a/app/Handlers/Events/Model/RuleHandler.php +++ b/app/Handlers/Events/Model/RuleHandler.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Handlers\Events\Model; use FireflyIII\Events\Model\Rule\RuleActionFailedOnArray; diff --git a/app/Models/Rule.php b/app/Models/Rule.php index 90058af7cf..7c499ad0d9 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -76,7 +76,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @method static Builder|Rule withoutTrashed() * @property int|null $user_group_id * @method static \Illuminate\Database\Eloquent\Builder|Rule whereUserGroupId($value) - * @property-read \FireflyIII\Models\UserGroup|null $userGroup + * @property-read UserGroup|null $userGroup * @mixin Eloquent */ class Rule extends Model @@ -125,14 +125,6 @@ class Rule extends Model throw new NotFoundHttpException(); } - /** - * @return BelongsTo - */ - public function user(): BelongsTo - { - return $this->belongsTo(User::class); - } - /** * @return HasMany */ @@ -167,6 +159,14 @@ class Rule extends Model $this->attributes['description'] = e($value); } + /** + * @return BelongsTo + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } + /** * @return BelongsTo */ diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php index 8f36fc3b9c..eb0008f3c3 100644 --- a/app/Models/TransactionGroup.php +++ b/app/Models/TransactionGroup.php @@ -61,7 +61,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @method static Builder|TransactionGroup withoutTrashed() * @property int|null $user_group_id * @method static \Illuminate\Database\Eloquent\Builder|TransactionGroup whereUserGroupId($value) - * @property-read \FireflyIII\Models\UserGroup|null $userGroup + * @property-read UserGroup|null $userGroup * @mixin Eloquent */ class TransactionGroup extends Model @@ -116,14 +116,6 @@ class TransactionGroup extends Model throw new NotFoundHttpException(); } - /** - * @return BelongsTo - */ - public function user(): BelongsTo - { - return $this->belongsTo(User::class); - } - /** * @return HasMany */ @@ -132,6 +124,14 @@ class TransactionGroup extends Model return $this->hasMany(TransactionJournal::class); } + /** + * @return BelongsTo + */ + public function user(): BelongsTo + { + return $this->belongsTo(User::class); + } + /** * @return BelongsTo */ diff --git a/app/Notifications/User/UserLogin.php b/app/Notifications/User/UserLogin.php index 5880947378..0e6ddd5cdb 100644 --- a/app/Notifications/User/UserLogin.php +++ b/app/Notifications/User/UserLogin.php @@ -33,7 +33,6 @@ use Illuminate\Notifications\Notification; use Illuminate\Support\Facades\Log; use Illuminate\Notifications\Messages\SlackMessage; - /** * Class UserLogin */ diff --git a/app/Repositories/Administration/Bill/BillRepository.php b/app/Repositories/Administration/Bill/BillRepository.php index bb123447a3..2ec273612a 100644 --- a/app/Repositories/Administration/Bill/BillRepository.php +++ b/app/Repositories/Administration/Bill/BillRepository.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Repositories\Administration\Bill; use Carbon\Carbon; diff --git a/app/Repositories/Administration/Bill/BillRepositoryInterface.php b/app/Repositories/Administration/Bill/BillRepositoryInterface.php index 12327f568c..8d26233f37 100644 --- a/app/Repositories/Administration/Bill/BillRepositoryInterface.php +++ b/app/Repositories/Administration/Bill/BillRepositoryInterface.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Repositories\Administration\Bill; use Carbon\Carbon; diff --git a/app/Repositories/Administration/Budget/AvailableBudgetRepository.php b/app/Repositories/Administration/Budget/AvailableBudgetRepository.php index b78672a86e..96a86e9afb 100644 --- a/app/Repositories/Administration/Budget/AvailableBudgetRepository.php +++ b/app/Repositories/Administration/Budget/AvailableBudgetRepository.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + + namespace FireflyIII\Repositories\Administration\Budget; use Carbon\Carbon; diff --git a/app/Repositories/Administration/Budget/AvailableBudgetRepositoryInterface.php b/app/Repositories/Administration/Budget/AvailableBudgetRepositoryInterface.php index 92ac772661..96119ee7f5 100644 --- a/app/Repositories/Administration/Budget/AvailableBudgetRepositoryInterface.php +++ b/app/Repositories/Administration/Budget/AvailableBudgetRepositoryInterface.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + + namespace FireflyIII\Repositories\Administration\Budget; use Carbon\Carbon; diff --git a/app/Repositories/Administration/Budget/BudgetRepository.php b/app/Repositories/Administration/Budget/BudgetRepository.php index b981341e0e..e793c7adec 100644 --- a/app/Repositories/Administration/Budget/BudgetRepository.php +++ b/app/Repositories/Administration/Budget/BudgetRepository.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + + namespace FireflyIII\Repositories\Administration\Budget; use FireflyIII\Support\Repositories\Administration\AdministrationTrait; diff --git a/app/Repositories/Administration/Budget/BudgetRepositoryInterface.php b/app/Repositories/Administration/Budget/BudgetRepositoryInterface.php index 74f503ab5c..38a29dbac6 100644 --- a/app/Repositories/Administration/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Administration/Budget/BudgetRepositoryInterface.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + + namespace FireflyIII\Repositories\Administration\Budget; use Illuminate\Support\Collection; diff --git a/app/Repositories/Administration/Budget/OperationsRepository.php b/app/Repositories/Administration/Budget/OperationsRepository.php index ddf845dfa2..22808664d6 100644 --- a/app/Repositories/Administration/Budget/OperationsRepository.php +++ b/app/Repositories/Administration/Budget/OperationsRepository.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + + namespace FireflyIII\Repositories\Administration\Budget; use Carbon\Carbon; diff --git a/app/Repositories/Administration/Budget/OperationsRepositoryInterface.php b/app/Repositories/Administration/Budget/OperationsRepositoryInterface.php index 8c7d522386..037b1f5f6b 100644 --- a/app/Repositories/Administration/Budget/OperationsRepositoryInterface.php +++ b/app/Repositories/Administration/Budget/OperationsRepositoryInterface.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + + namespace FireflyIII\Repositories\Administration\Budget; use Carbon\Carbon; @@ -36,8 +39,8 @@ interface OperationsRepositoryInterface * which have the specified budget set to them. It's grouped per currency, with as few details in the array * as possible. Amounts are always negative. * - * @param Carbon $start - * @param Carbon $end + * @param Carbon $start + * @param Carbon $end * @param Collection|null $accounts * @param Collection|null $budgets * diff --git a/app/Repositories/Administration/PiggyBank/PiggyBankRepository.php b/app/Repositories/Administration/PiggyBank/PiggyBankRepository.php index 49b3c5413e..1b06aece82 100644 --- a/app/Repositories/Administration/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/Administration/PiggyBank/PiggyBankRepository.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + + namespace FireflyIII\Repositories\Administration\PiggyBank; use FireflyIII\Support\Repositories\Administration\AdministrationTrait; diff --git a/app/Repositories/Administration/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/Administration/PiggyBank/PiggyBankRepositoryInterface.php index a128e3827a..10fae5bbcb 100644 --- a/app/Repositories/Administration/PiggyBank/PiggyBankRepositoryInterface.php +++ b/app/Repositories/Administration/PiggyBank/PiggyBankRepositoryInterface.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Repositories\Administration\PiggyBank; use Illuminate\Support\Collection; diff --git a/app/Repositories/UserGroup/UserGroupRepository.php b/app/Repositories/UserGroup/UserGroupRepository.php index 1d396b0497..4071067c08 100644 --- a/app/Repositories/UserGroup/UserGroupRepository.php +++ b/app/Repositories/UserGroup/UserGroupRepository.php @@ -1,4 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Repositories\UserGroup; use FireflyIII\Factory\UserGroupFactory; diff --git a/app/Repositories/UserGroup/UserGroupRepositoryInterface.php b/app/Repositories/UserGroup/UserGroupRepositoryInterface.php index 1a2ad681ad..143d7b2a60 100644 --- a/app/Repositories/UserGroup/UserGroupRepositoryInterface.php +++ b/app/Repositories/UserGroup/UserGroupRepositoryInterface.php @@ -1,4 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Repositories\UserGroup; use FireflyIII\User; diff --git a/app/Support/Http/Api/CleansChartData.php b/app/Support/Http/Api/CleansChartData.php index 90cdba8c6a..bda87b5a7c 100644 --- a/app/Support/Http/Api/CleansChartData.php +++ b/app/Support/Http/Api/CleansChartData.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Support\Http\Api; use FireflyIII\Exceptions\FireflyException; diff --git a/app/Support/Http/Api/ExchangeRateConverter.php b/app/Support/Http/Api/ExchangeRateConverter.php index a3fb105ee3..2051366405 100644 --- a/app/Support/Http/Api/ExchangeRateConverter.php +++ b/app/Support/Http/Api/ExchangeRateConverter.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Support\Http\Api; use Carbon\Carbon; diff --git a/app/Support/Notifications/UrlValidator.php b/app/Support/Notifications/UrlValidator.php index 8948c00f82..5f6106ce9d 100644 --- a/app/Support/Notifications/UrlValidator.php +++ b/app/Support/Notifications/UrlValidator.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Support\Notifications; /** diff --git a/app/Transformers/V2/BillTransformer.php b/app/Transformers/V2/BillTransformer.php index e4b529c61c..e77318487b 100644 --- a/app/Transformers/V2/BillTransformer.php +++ b/app/Transformers/V2/BillTransformer.php @@ -175,7 +175,10 @@ class BillTransformer extends AbstractTransformer 'native_amount' => $this->converter->convert($currencies[$currencyId], $this->default, $journal->date, $transaction['amount']), 'foreign_native_amount' => '' === (string)$transaction['foreign_amount'] ? null : $this->converter->convert( $currencies[$foreignCurrencyId], - $this->default, $journal->date, $transaction['foreign_amount']), + $this->default, + $journal->date, + $transaction['foreign_amount'] + ), ]; } } diff --git a/app/Transformers/V2/UserGroupTransformer.php b/app/Transformers/V2/UserGroupTransformer.php index 6e72e221fa..3f7c44b0d2 100644 --- a/app/Transformers/V2/UserGroupTransformer.php +++ b/app/Transformers/V2/UserGroupTransformer.php @@ -1,4 +1,6 @@ . */ +declare(strict_types=1); + namespace FireflyIII\Transformers\V2; use FireflyIII\Enums\UserRoleEnum; diff --git a/app/User.php b/app/User.php index afb63fcf9d..d4cfe96cf3 100644 --- a/app/User.php +++ b/app/User.php @@ -406,30 +406,45 @@ class User extends Authenticatable ->whereIn('user_role_id', $dbRolesIds) ->where('user_group_id', $userGroup->id)->get(); if (0 === $groupMemberships->count()) { - app('log')->error(sprintf('User #%d "%s" does not have roles %s in user group #%d "%s"', - $this->id, $this->email, - join(', ', $roles), $userGroup->id, $userGroup->title)); + app('log')->error(sprintf( + 'User #%d "%s" does not have roles %s in user group #%d "%s"', + $this->id, + $this->email, + join(', ', $roles), + $userGroup->id, + $userGroup->title + )); return false; } foreach ($groupMemberships as $membership) { - app('log')->debug(sprintf('User #%d "%s" has role "%s" in user group #%d "%s"', - $this->id, $this->email, - $membership->userRole->title, $userGroup->id, $userGroup->title)); - if (in_array($membership->userRole->title, $dbRolesTitles)) { + app('log')->debug(sprintf( + 'User #%d "%s" has role "%s" in user group #%d "%s"', + $this->id, + $this->email, + $membership->userRole->title, + $userGroup->id, + $userGroup->title + )); + if (in_array($membership->userRole->title, $dbRolesTitles, true)) { app('log')->debug(sprintf('Return true, found role "%s"', $membership->userRole->title)); return true; } } - app('log')->error(sprintf('User #%d "%s" does not have roles %s in user group #%d "%s"', - $this->id, $this->email, - join(', ', $roles), $userGroup->id, $userGroup->title)); + app('log')->error(sprintf( + 'User #%d "%s" does not have roles %s in user group #%d "%s"', + $this->id, + $this->email, + join(', ', $roles), + $userGroup->id, + $userGroup->title + )); return false; -// // not necessary, should always return true: -// $result = $groupMembership->userRole->title === $role->value; -// app('log')->error(sprintf('Does user #%d "%s" have role "%s" in user group #%d "%s"? %s', -// $this->id, $this->email, -// $role->value, $userGroup->id, $userGroup->title, var_export($result, true))); -// return $result; + // // not necessary, should always return true: + // $result = $groupMembership->userRole->title === $role->value; + // app('log')->error(sprintf('Does user #%d "%s" have role "%s" in user group #%d "%s"? %s', + // $this->id, $this->email, + // $role->value, $userGroup->id, $userGroup->title, var_export($result, true))); + // return $result; } /** @@ -666,7 +681,7 @@ class User extends Authenticatable */ public function userGroup(): BelongsTo { - return $this->belongsTo(UserGroup::class,); + return $this->belongsTo(UserGroup::class, ); } /** diff --git a/artisan b/artisan index 67a3329b18..eb4621bc48 100755 --- a/artisan +++ b/artisan @@ -33,8 +33,8 @@ $app = require_once __DIR__.'/bootstrap/app.php'; $kernel = $app->make(Illuminate\Contracts\Console\Kernel::class); $status = $kernel->handle( - $input = new Symfony\Component\Console\Input\ArgvInput, - new Symfony\Component\Console\Output\ConsoleOutput + $input = new Symfony\Component\Console\Input\ArgvInput(), + new Symfony\Component\Console\Output\ConsoleOutput() ); /* diff --git a/config/cors.php b/config/cors.php index 47942ff920..69da8e5802 100644 --- a/config/cors.php +++ b/config/cors.php @@ -1,5 +1,26 @@ . + */ + declare(strict_types=1); return [ diff --git a/config/hashing.php b/config/hashing.php index f2221ff4e5..a82faad299 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -1,5 +1,26 @@ . + */ + declare(strict_types=1); return [ diff --git a/database/migrations/2023_08_11_192521_upgrade_og_table.php b/database/migrations/2023_08_11_192521_upgrade_og_table.php index 0ff4508b5c..1285607771 100644 --- a/database/migrations/2023_08_11_192521_upgrade_og_table.php +++ b/database/migrations/2023_08_11_192521_upgrade_og_table.php @@ -1,5 +1,26 @@ . + */ + declare(strict_types=1); use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist; diff --git a/public/v3/index.html b/public/v3/index.html index 80d0b33b80..4b4b4cb062 100644 --- a/public/v3/index.html +++ b/public/v3/index.html @@ -1 +1,21 @@ -Firefly III
\ No newline at end of file + + +Firefly III
diff --git a/resources/assets/v2/pages/shared/dates.js b/resources/assets/v2/pages/shared/dates.js index f5922286f8..cf305d1e75 100644 --- a/resources/assets/v2/pages/shared/dates.js +++ b/resources/assets/v2/pages/shared/dates.js @@ -1,3 +1,23 @@ +/* + * dates.js + * Copyright (c) 2023 james@firefly-iii.org + * + * This file is part of Firefly III (https://github.com/firefly-iii). + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + import { addMonths, endOfDay, diff --git a/resources/assets/v2/support/get-viewrange.js b/resources/assets/v2/support/get-viewrange.js index 06f03efa3a..45084cfa61 100644 --- a/resources/assets/v2/support/get-viewrange.js +++ b/resources/assets/v2/support/get-viewrange.js @@ -1,3 +1,23 @@ +/* + * get-viewrange.js + * Copyright (c) 2023 james@firefly-iii.org + * + * This file is part of Firefly III (https://github.com/firefly-iii). + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + import { endOfDay, endOfMonth, endOfQuarter, endOfWeek, diff --git a/resources/lang/en_US/rules.php b/resources/lang/en_US/rules.php index 208a9267aa..389fb335ff 100644 --- a/resources/lang/en_US/rules.php +++ b/resources/lang/en_US/rules.php @@ -1,6 +1,6 @@ . */ +declare(strict_types=1); return [ 'main_message' => 'Action ":action", present in rule ":rule", could not be applied to transaction #:group: :error', diff --git a/vite.config.js b/vite.config.js index 5da8d92e40..d9e9840733 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,3 +1,23 @@ +/* + * vite.config.js + * Copyright (c) 2023 james@firefly-iii.org + * + * This file is part of Firefly III (https://github.com/firefly-iii). + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + import {defineConfig} from 'vite'; import laravel from 'laravel-vite-plugin'; import manifestSRI from 'vite-plugin-manifest-sri';