Compare commits

...

89 Commits

Author SHA1 Message Date
github-actions[bot]
e82459cd29 Merge pull request #10364 from firefly-iii/release-1748149540
🤖 Automatically merge the PR into the develop branch.
2025-05-25 07:05:46 +02:00
JC5
6dcf80967e 🤖 Auto commit for release 'develop' on 2025-05-25 2025-05-25 07:05:40 +02:00
James Cole
3d9edaeaac Restore missing facades. Whoops. 2025-05-25 07:01:31 +02:00
github-actions[bot]
4a5a31bf69 Merge pull request #10362 from firefly-iii/release-1748148584
🤖 Automatically merge the PR into the develop branch.
2025-05-25 06:49:50 +02:00
JC5
5f73e37657 🤖 Auto commit for release 'v6.2.14' on 2025-05-25 2025-05-25 06:49:44 +02:00
github-actions[bot]
7a9c0a8172 Merge pull request #10361 from firefly-iii/release-1748147782
🤖 Automatically merge the PR into the develop branch.
2025-05-25 06:36:31 +02:00
JC5
39914e2380 🤖 Auto commit for release 'develop' on 2025-05-25 2025-05-25 06:36:22 +02:00
James Cole
5a3240f69d Update changelog. 2025-05-25 06:27:05 +02:00
James Cole
19e5fd6277 Back to passport 12 for the time being. 2025-05-25 06:24:01 +02:00
James Cole
e9844dc2f5 Fix #10353 2025-05-24 19:48:09 +02:00
James Cole
c9f07c093a Fix tests and migrations 2025-05-24 17:30:08 +02:00
James Cole
6a986d8119 Merge pull request #10352 from firefly-iii/rector-cleanup-2
Rector cleanup 2
2025-05-24 17:20:07 +02:00
James Cole
f780de9e71 Replace magic facades 2025-05-24 17:19:18 +02:00
James Cole
b830bd2732 Replace magic facades 2025-05-24 17:15:46 +02:00
James Cole
e333dedeec Replace magic facades. 2025-05-24 17:07:12 +02:00
James Cole
6e5a08245c Rector code cleanup 2025-05-24 16:39:20 +02:00
James Cole
6a82a813e0 Fix version, I guess. 2025-05-24 07:24:28 +02:00
James Cole
7992ecf7f6 Use other workflow thing. 2025-05-24 07:22:18 +02:00
James Cole
967f7cb015 Move fix around 2025-05-24 06:37:19 +02:00
James Cole
7ca5e03752 Fix access rights in Sonar test 2025-05-24 06:36:06 +02:00
github-actions[bot]
abc6c611fa Merge pull request #10344 from firefly-iii/release-1748061087
🤖 Automatically merge the PR into the develop branch.
2025-05-24 06:31:36 +02:00
JC5
7673b939a1 🤖 Auto commit for release 'v6.2.13' on 2025-05-24 2025-05-24 06:31:28 +02:00
github-actions[bot]
c029bd42a7 Merge pull request #10343 from firefly-iii/release-1748060657
🤖 Automatically merge the PR into the develop branch.
2025-05-24 06:24:24 +02:00
JC5
63d051d9ba 🤖 Auto commit for release 'develop' on 2025-05-24 2025-05-24 06:24:17 +02:00
James Cole
1ec5ee08aa Update changelog and some final fixes. 2025-05-24 06:19:07 +02:00
James Cole
66be8ee80e Merge pull request #10342 from firefly-iii/fix-phpunit
Fix phpunit tests
2025-05-24 06:09:47 +02:00
James Cole
d26d1b4b87 Fix phpunit tests 2025-05-24 06:07:59 +02:00
James Cole
3716b50616 Merge pull request #10341 from firefly-iii/fix-10320
Fix #10320
2025-05-24 05:53:39 +02:00
James Cole
5e398bd07a Merge pull request #10340 from firefly-iii/nestor
Nestor
2025-05-24 05:53:10 +02:00
James Cole
2ee000debb Fix #10320 2025-05-24 05:52:46 +02:00
James Cole
b8e33201bd Not sure why I keep calling this tool nestor, it's called rector 2025-05-24 05:52:31 +02:00
James Cole
1c33be4828 Various nestor-related fixes. 2025-05-24 05:46:39 +02:00
James Cole
c40229e9fa Various nestor-related fixes. 2025-05-24 05:40:20 +02:00
James Cole
b7ec7625c0 Merge pull request #10339 from firefly-iii/fix-10336
Fix #10336
2025-05-24 05:36:04 +02:00
James Cole
64170d4957 Fix #10336 2025-05-24 05:35:31 +02:00
James Cole
d82c3b55e0 Merge pull request #10331 from firefly-iii/fix-10308
Fix #10308
2025-05-22 06:41:46 +02:00
James Cole
01800a3534 Fix #10308 2025-05-22 06:41:17 +02:00
James Cole
01404bf9cd Merge pull request #10330 from firefly-iii/fix-10305
Fix #10305
2025-05-22 06:11:22 +02:00
James Cole
2f9d73c0b3 Fix #10305 2025-05-22 06:10:54 +02:00
James Cole
670c2e4872 Merge pull request #10329 from firefly-iii/fix-10302
Fix #10302
2025-05-22 06:07:02 +02:00
James Cole
1261122a57 Fix #10302 2025-05-22 06:06:30 +02:00
James Cole
2a17ec9280 Merge pull request #10328 from firefly-iii/fix-10290
Fix #10290
2025-05-22 06:03:05 +02:00
James Cole
1424410115 Fix #10290 2025-05-22 06:02:32 +02:00
James Cole
f20eccf279 Update static cron token 2025-05-19 19:45:19 +02:00
github-actions[bot]
c18cbe1d26 Merge pull request #10319 from firefly-iii/release-1747670547
🤖 Automatically merge the PR into the develop branch.
2025-05-19 18:02:33 +02:00
JC5
d5a3ae43e0 🤖 Auto commit for release 'develop' on 2025-05-19 2025-05-19 18:02:27 +02:00
James Cole
767abacd27 Add spaces. 2025-05-19 17:58:37 +02:00
James Cole
2b3172ba8e Update packcages 2025-05-19 17:53:33 +02:00
github-actions[bot]
1ff8a48ca3 Merge pull request #10317 from firefly-iii/release-1747668888
🤖 Automatically merge the PR into the develop branch.
2025-05-19 17:34:55 +02:00
JC5
5b7645b6d5 🤖 Auto commit for release 'develop' on 2025-05-19 2025-05-19 17:34:48 +02:00
James Cole
ae82474b19 Update packages. 2025-05-19 17:30:53 +02:00
github-actions[bot]
d38c59c5b1 Merge pull request #10313 from firefly-iii/release-1747625288
🤖 Automatically merge the PR into the develop branch.
2025-05-19 05:28:15 +02:00
JC5
a4205afb7b 🤖 Auto commit for release 'develop' on 2025-05-19 2025-05-19 05:28:08 +02:00
github-actions[bot]
75e187ee34 Merge pull request #10303 from firefly-iii/release-1747228276
🤖 Automatically merge the PR into the develop branch.
2025-05-14 15:11:26 +02:00
JC5
a37ed82bb4 🤖 Auto commit for release 'develop' on 2025-05-14 2025-05-14 15:11:16 +02:00
Sander Dorigo
a7233de561 Downgrade 2025-05-14 15:06:10 +02:00
github-actions[bot]
e87c5eee6b Merge pull request #10301 from firefly-iii/release-1747184469
🤖 Automatically merge the PR into the develop branch.
2025-05-14 03:01:16 +02:00
JC5
7a75290709 🤖 Auto commit for release 'develop' on 2025-05-14 2025-05-14 03:01:10 +02:00
James Cole
981f6df9ee Merge branch 'main' into develop 2025-05-14 02:57:20 +02:00
James Cole
c4572c66d3 Restore and update packages. 2025-05-14 02:56:53 +02:00
github-actions[bot]
8e7d750a5a Merge pull request #10298 from firefly-iii/release-1747132859
🤖 Automatically merge the PR into the develop branch.
2025-05-13 12:41:07 +02:00
JC5
94961466f9 🤖 Auto commit for release 'develop' on 2025-05-13 2025-05-13 12:40:59 +02:00
Sander Dorigo
0f3fe45b06 Make parameter optional 2025-05-13 12:36:26 +02:00
Sander Dorigo
0650457ea5 Experimental extra fix for #10265 2025-05-12 13:25:01 +02:00
github-actions[bot]
2e1ce03f13 Merge pull request #10296 from firefly-iii/release-1747034656
🤖 Automatically merge the PR into the develop branch.
2025-05-12 09:24:22 +02:00
JC5
9b345db623 🤖 Auto commit for release 'develop' on 2025-05-12 2025-05-12 09:24:16 +02:00
Sander Dorigo
c1afcc5219 add code improvement 2025-05-12 09:20:38 +02:00
Sander Dorigo
fb394b7f45 Fix nullpointer 2025-05-12 09:19:42 +02:00
Sander Dorigo
381598f1bb Fix optional web routes 2025-05-12 08:39:21 +02:00
James Cole
25b7a76da9 Merge pull request #10294 from firefly-iii/dependabot/github_actions/github/command-2.0.1 2025-05-12 06:37:59 +02:00
dependabot[bot]
4b03ebe3cb Bump github/command from 2.0.0 to 2.0.1
Bumps [github/command](https://github.com/github/command) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/github/command/releases)
- [Commits](https://github.com/github/command/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: github/command
  dependency-version: 2.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-12 03:26:53 +00:00
github-actions[bot]
664c59136a Merge pull request #10293 from firefly-iii/release-1747020359
🤖 Automatically merge the PR into the develop branch.
2025-05-12 05:26:07 +02:00
JC5
27b61aae73 🤖 Auto commit for release 'develop' on 2025-05-12 2025-05-12 05:26:00 +02:00
github-actions[bot]
d90fcd1889 Merge pull request #10288 from firefly-iii/release-1746966536
🤖 Automatically merge the PR into the develop branch.
2025-05-11 14:29:03 +02:00
JC5
979d5c579b 🤖 Auto commit for release 'develop' on 2025-05-11 2025-05-11 14:28:56 +02:00
James Cole
5124ca1738 Introduce change for CI to catch. 2025-05-11 14:24:59 +02:00
James Cole
ac5d9b656a Merge pull request #10287 from firefly-iii/add-safe
Include safe methods and require the correct package.
2025-05-11 14:19:33 +02:00
James Cole
9a02739251 Include safe methods and require the correct package. 2025-05-11 14:19:07 +02:00
James Cole
4af2aadc48 Merge pull request #10286 from firefly-iii/remove-safe-methods
Remove safe methods.
2025-05-11 14:09:02 +02:00
James Cole
84779b8d02 Remove safe methods. 2025-05-11 14:08:32 +02:00
github-actions[bot]
145e8d23f0 Merge pull request #10285 from firefly-iii/release-1746964861
🤖 Automatically merge the PR into the develop branch.
2025-05-11 14:01:08 +02:00
JC5
d0ba0583a5 🤖 Auto commit for release 'develop' on 2025-05-11 2025-05-11 14:01:01 +02:00
James Cole
17d8b54280 Merge pull request #10284 from firefly-iii/fix-missing-import-2
Temp commit because the build fails otherwise and I haven't fixed tha…
2025-05-11 13:56:41 +02:00
James Cole
2cf0bfe3c4 Temp commit because the build fails otherwise and I haven't fixed that yet. 2025-05-11 13:56:07 +02:00
James Cole
070a8cf148 Remove safe functions 2025-05-11 13:16:09 +02:00
github-actions[bot]
f94c21446a Merge pull request #10283 from firefly-iii/release-1746961946
🤖 Automatically merge the PR into the develop branch.
2025-05-11 13:12:33 +02:00
JC5
1ef1873016 🤖 Auto commit for release 'develop' on 2025-05-11 2025-05-11 13:12:26 +02:00
James Cole
32e4e29e7c Merge pull request #10282 from firefly-iii/fix-missing-import
Fix missing import.
2025-05-11 13:08:28 +02:00
James Cole
65ca0dd9e0 Fix missing import. 2025-05-11 13:07:37 +02:00
144 changed files with 992 additions and 754 deletions

View File

@@ -1,21 +1,70 @@
<?php
/*
* rector.php
* Copyright (c) 2025 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 https://www.gnu.org/licenses/.
*/
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector;
return RectorConfig::configure()
->withSkip([
ChangeOrIfContinueToMultiContinueRector::class,
])
->withPaths([
__DIR__ . '/../app',
__DIR__ . '/../bootstrap',
__DIR__ . '/../config',
__DIR__ . '/../public',
__DIR__ . '/../resources',
__DIR__ . '/../routes',
__DIR__ . '/../tests',
// __DIR__ . '/../app',
__DIR__ . '/../app/Api',
__DIR__ . '/../app/Http',
// __DIR__ . '/../bootstrap',
// __DIR__ . '/../config',
// __DIR__ . '/../public',
// __DIR__ . '/../resources',
// __DIR__ . '/../routes',
// __DIR__ . '/../tests',
])
// uncomment to reach your current PHP version
// uncomment to reach your current PHP version
->withPhpSets()
->withPreparedSets(
codingStyle : false, // leave false
privatization: false, // leave false.
naming : false, // leave false
instanceOf : true,
earlyReturn : true,
strictBooleans : true,
carbon : true,
rectorPreset : true,
phpunitCodeQuality : true,
doctrineCodeQuality: true,
symfonyCodeQuality : true,
symfonyConfigs : true
)
->withComposerBased(
twig: true,
doctrine: true,
phpunit: true,
symfony: true)
->withTypeCoverageLevel(0)
->withDeadCodeLevel(0)
->withCodeQualityLevel(0);
->withCodeQualityLevel(0)
->withImportNames(removeUnusedImports: true);// import statements instead of full classes.

View File

@@ -289,7 +289,7 @@ ALLOW_WEBHOOKS=false
#
# You can set this variable from a file by appending it with _FILE
#
STATIC_CRON_TOKEN=
STATIC_CRON_TOKEN=PLEASE_REPLACE_WITH_32_CHAR_CODE
# You can fine tune the start-up of a Docker container by editing these environment variables.
# Use this at your own risk. Disabling certain checks and features may result in lots of inconsistent data.

View File

@@ -13,7 +13,7 @@ jobs:
close_duplicates:
runs-on: ubuntu-latest
steps:
- uses: github/command@v2.0.0
- uses: github/command@v2.0.1
id: command
with:
allowed_contexts: "issue"

View File

@@ -51,7 +51,10 @@ jobs:
wget -q https://github.com/firefly-iii/test-fixtures/raw/refs/heads/main/test-database.sqlite -O storage/database/database.sqlite
- name: "Upgrades the database to the latest version"
run: php artisan firefly-iii:upgrade-database
run: |
php artisan firefly-iii:upgrade-database
chmod 600 storage/oauth-public.key
chmod 600 storage/oauth-private.key
- name: "Integrity Database Report"
run: php artisan firefly-iii:report-integrity
@@ -63,7 +66,7 @@ jobs:
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
uses: SonarSource/sonarqube-scan-action@v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_PERSONAL_ACCESS_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Enums\UserRoleEnum;
@@ -102,7 +103,7 @@ class TransactionController extends Controller
if (is_numeric($data['query'])) {
// search for group, not journal.
$firstResult = $this->groupRepository->find((int) $data['query']);
if (null !== $firstResult) {
if ($firstResult instanceof TransactionGroup) {
// group may contain multiple journals, each a result:
foreach ($firstResult->transactionJournals as $journal) {
$result->push($journal);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Chart;
use FireflyIII\Models\TransactionCurrency;
use Carbon\Carbon;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Chart\ChartRequest;
@@ -99,7 +100,7 @@ class AccountController extends Controller
private function renderAccountData(array $params, Account $account): void
{
$currency = $this->repository->getAccountCurrency($account);
if (null === $currency) {
if (!$currency instanceof TransactionCurrency) {
$currency = $this->default;
}
$currentSet = [

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\CurrencyExchangeRate;
use Carbon\Carbon;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\DestroyRequest;
use FireflyIII\Enums\UserRoleEnum;
@@ -59,11 +60,11 @@ class DestroyController extends Controller
public function destroy(DestroyRequest $request, TransactionCurrency $from, TransactionCurrency $to): JsonResponse
{
$date = $request->getDate();
if (null === $date) {
if (!$date instanceof Carbon) {
throw new ValidationException('Date is required');
}
$rate = $this->repository->getSpecificRateOnDate($from, $to, $date);
if (null === $rate) {
if (!$rate instanceof CurrencyExchangeRate) {
throw new NotFoundHttpException();
}
$this->repository->deleteRate($rate);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\CurrencyExchangeRate;
use FireflyIII\Models\CurrencyExchangeRate;
use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\StoreRequest;
use FireflyIII\Api\V2\Controllers\Controller;
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
@@ -61,11 +62,11 @@ class StoreController extends Controller
// already has rate?
$object = $this->repository->getSpecificRateOnDate($from, $to, $date);
if (null !== $object) {
if ($object instanceof CurrencyExchangeRate) {
// just update it, no matter.
$rate = $this->repository->updateExchangeRate($object, $rate, $date);
}
if (null === $object) {
if (!$object instanceof CurrencyExchangeRate) {
// store new
$rate = $this->repository->storeExchangeRate($from, $to, $rate, $date);
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency;
use Illuminate\Support\Facades\Validator;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\TransactionCurrency;
@@ -74,15 +75,15 @@ class DestroyController extends Controller
if (!$this->userRepository->hasRole($admin, 'owner')) {
// access denied:
$messages = ['currency_code' => '200005: You need the "owner" role to do this.'];
\Validator::make([], $rules, $messages)->validate();
Validator::make([], $rules, $messages)->validate();
}
if ($this->repository->currencyInUse($currency)) {
$messages = ['currency_code' => '200006: Currency in use.'];
\Validator::make([], $rules, $messages)->validate();
Validator::make([], $rules, $messages)->validate();
}
if ($this->repository->isFallbackCurrency($currency)) {
$messages = ['currency_code' => '200026: Currency is fallback.'];
\Validator::make([], $rules, $messages)->validate();
Validator::make([], $rules, $messages)->validate();
}
$this->repository->destroy($currency);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\TransactionLink;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\TransactionLink\StoreRequest;
use FireflyIII\Exceptions\FireflyException;
@@ -81,7 +82,7 @@ class StoreController extends Controller
$data = $request->getAll();
$inward = $this->journalRepository->find($data['inward_id'] ?? 0);
$outward = $this->journalRepository->find($data['outward_id'] ?? 0);
if (null === $inward || null === $outward) {
if (!$inward instanceof TransactionJournal || !$outward instanceof TransactionJournal) {
throw new FireflyException('200024: Source or destination does not exist.');
}
$data['direction'] = 'inward';

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType;
use Illuminate\Support\Facades\Validator;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\StoreRequest;
use FireflyIII\Exceptions\FireflyException;
@@ -81,7 +82,7 @@ class StoreController extends Controller
if (!$this->userRepository->hasRole($admin, 'owner')) {
// access denied:
$messages = ['name' => '200005: You need the "owner" role to do this.'];
\Validator::make([], $rules, $messages)->validate();
Validator::make([], $rules, $messages)->validate();
}
$data = $request->getAll();
// if currency ID is 0, find the currency by the code:

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType;
use Illuminate\Support\Facades\Validator;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\UpdateRequest;
use FireflyIII\Exceptions\FireflyException;
@@ -85,7 +86,7 @@ class UpdateController extends Controller
if (!$this->userRepository->hasRole($admin, 'owner')) {
$messages = ['name' => '200005: You need the "owner" role to do this.'];
\Validator::make([], $rules, $messages)->validate();
Validator::make([], $rules, $messages)->validate();
}
$data = $request->getAll();

View File

@@ -674,15 +674,14 @@ class BasicController extends Controller
*/
protected function notInDateRange(Carbon $date, Carbon $start, Carbon $end): bool // Validate a preference
{
$result = false;
if ($start->greaterThanOrEqualTo($date) && $end->greaterThanOrEqualTo($date)) {
$result = true;
return true;
}
// start and end in the past? use $end
if ($start->lessThanOrEqualTo($date) && $end->lessThanOrEqualTo($date)) {
$result = true;
return true;
}
return $result;
return false;
}
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\System;
use Illuminate\Support\Facades\Validator;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\System\UpdateRequest;
use FireflyIII\Exceptions\FireflyException;
@@ -158,7 +159,7 @@ class ConfigurationController extends Controller
$rules = ['value' => 'required'];
if (!$this->repository->hasRole(auth()->user(), 'owner')) {
$messages = ['value' => '200005: You need the "owner" role to do this.'];
\Validator::make([], $rules, $messages)->validate();
Validator::make([], $rules, $messages)->validate();
}
$data = $request->getAll();
$shortName = str_replace('configuration.', '', $name);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests\System;
use Carbon\Carbon;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
@@ -58,7 +59,7 @@ class CronRequest extends FormRequest
$data['date'] = $this->getCarbonDate('date');
}
// catch NULL.
if (null === $data['date']) {
if (!$data['date'] instanceof Carbon) {
$data['date'] = today(config('app.timezone'));
}

View File

@@ -90,7 +90,7 @@ class AccountController extends Controller
'meta' => [
'type' => $account->accountType->type,
// TODO is multi currency property.
'currency_id' => null === $currency ? null : (string) $currency->id,
'currency_id' => $currency instanceof TransactionCurrency ? (string) $currency->id : null,
'currency_code' => $currency?->code,
'currency_symbol' => $currency?->symbol,
'currency_decimal_places' => $currency?->decimal_places,

View File

@@ -94,7 +94,7 @@ class AccountController extends Controller
private function renderAccountData(array $params, Account $account): void
{
$currency = $this->repository->getAccountCurrency($account);
if (null === $currency) {
if (!$currency instanceof TransactionCurrency) {
$currency = $this->default;
}
$currentSet = [

View File

@@ -117,7 +117,7 @@ class Controller extends BaseController
app('log')->warning(sprintf('Ignored invalid date "%s" in API v2 controller parameter check: %s', substr((string) $date, 0, 20), $e->getMessage()));
}
// out of range? set to null.
if (null !== $obj && ($obj->year <= 1900 || $obj->year > 2099)) {
if ($obj instanceof Carbon && ($obj->year <= 1900 || $obj->year > 2099)) {
app('log')->warning(sprintf('Refuse to use date "%s" in API v2 controller parameter check: %s', $field, $obj->toAtomString()));
$obj = null;
}

View File

@@ -398,15 +398,14 @@ class BasicController extends Controller
*/
protected function notInDateRange(Carbon $date, Carbon $start, Carbon $end): bool // Validate a preference
{
$result = false;
if ($start->greaterThanOrEqualTo($date) && $end->greaterThanOrEqualTo($date)) {
$result = true;
return true;
}
// start and end in the past? use $end
if ($start->lessThanOrEqualTo($date) && $end->lessThanOrEqualTo($date)) {
$result = true;
return true;
}
return $result;
return false;
}
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\Transaction\List;
use Carbon\Carbon;
use FireflyIII\Api\V2\Controllers\Controller;
use FireflyIII\Api\V2\Request\Model\Transaction\ListRequest;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
@@ -62,11 +63,11 @@ class AccountController extends Controller
$start = $request->getStartDate();
$end = $request->getEndDate();
if (null !== $start) {
if ($start instanceof Carbon) {
app('log')->debug(sprintf('Set start date to %s', $start->toIso8601String()));
$collector->setStart($start);
}
if (null !== $end) {
if ($end instanceof Carbon) {
app('log')->debug(sprintf('Set end date to %s', $start->toIso8601String()));
$collector->setEnd($end);
}

View File

@@ -53,7 +53,7 @@ class InfiniteListRequest extends FormRequest
$start = $this->getStartDate();
$end = $this->getEndDate();
if (null !== $start && null !== $end) {
if ($start instanceof Carbon && $end instanceof Carbon) {
$array['start'] = $start->format('Y-m-d');
$array['end'] = $end->format('Y-m-d');
}

View File

@@ -49,7 +49,7 @@ class ListRequest extends FormRequest
$start = $this->getStartDate();
$end = $this->getEndDate();
if (null !== $start && null !== $end) {
if ($start instanceof Carbon && $end instanceof Carbon) {
$array['start'] = $start->format('Y-m-d');
$array['end'] = $end->format('Y-m-d');
}

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Console\Commands\Correction;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Schema;
class CorrectsDatabase extends Command
{
@@ -40,7 +41,7 @@ class CorrectsDatabase extends Command
public function handle(): int
{
// if table does not exist, return false
if (!\Schema::hasTable('users')) {
if (!Schema::hasTable('users')) {
$this->friendlyError('No "users"-table, will not continue.');
return 1;

View File

@@ -163,7 +163,7 @@ class CorrectsUnevenAmount extends Command
Log::error($e->getTraceAsString());
}
if (0 !== $res) {
$this->fixJournal($entry->transaction_journal_id);
$this->fixJournal((int) $entry->transaction_journal_id);
}
}
}

View File

@@ -273,7 +273,7 @@ class ExportsData extends Command
*/
private function exportData(array $options, array $data): void
{
$date = \Safe\date('Y_m_d');
$date = date('Y_m_d');
foreach ($data as $key => $content) {
$file = sprintf('%s%s_%s.csv', $options['directory'], $date, $key);
if (false === $options['force'] && file_exists($file)) {

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Console\Commands\Integrity;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Schema;
class ReportsIntegrity extends Command
{
@@ -41,7 +42,7 @@ class ReportsIntegrity extends Command
public function handle(): int
{
// if table does not exist, return false
if (!\Schema::hasTable('users')) {
if (!Schema::hasTable('users')) {
return 1;
}
$commands = [

View File

@@ -111,8 +111,8 @@ class OutputsInstructions extends Command
*/
private function showLogo(): void
{
$today = \Safe\date('m-d');
$month = \Safe\date('m');
$today = date('m-d');
$month = date('m');
// variation in colors and effects just because I can!
// default is Ukraine flag:
$colors = ['blue', 'blue', 'blue', 'yellow', 'yellow', 'yellow', 'default', 'default'];

View File

@@ -31,6 +31,7 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface;
use Illuminate\Console\Command;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Schema;
class AddsTransactionIdentifiers extends Command
{
@@ -65,7 +66,7 @@ class AddsTransactionIdentifiers extends Command
}
// if table does not exist, return false
if (!\Schema::hasTable('transaction_journals')) {
if (!Schema::hasTable('transaction_journals')) {
return 0;
}

View File

@@ -28,7 +28,7 @@ use Illuminate\Support\Facades\Log;
use Safe\Exceptions\InfoException;
try {
set_time_limit(0);
\Safe\set_time_limit(0);
} catch (InfoException) {
Log::warning('set_time_limit returned false. This could be an issue, unless you also run XDebug.');
}

View File

@@ -366,8 +366,8 @@ class UpgradesToGroups extends Command
{
$groupId = DB::table('transaction_groups')->insertGetId(
[
'created_at' => \Safe\date('Y-m-d H:i:s'),
'updated_at' => \Safe\date('Y-m-d H:i:s'),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'title' => null,
'user_id' => $array['user_id'],
]

View File

@@ -45,6 +45,7 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
// temp
/**
* Class Handler
*/
@@ -227,7 +228,7 @@ class Handler extends ExceptionHandler
$data = [
'class' => $e::class,
'errorMessage' => $e->getMessage(),
'time' => \Safe\date('r'),
'time' => date('r'),
'stackTrace' => $e->getTraceAsString(),
'file' => $e->getFile(),
'line' => $e->getLine(),

View File

@@ -32,6 +32,7 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Rules\UniqueIban;
use FireflyIII\Services\Internal\Update\AccountUpdateService;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Validator;
/**
* Class TransactionFactory
@@ -152,7 +153,7 @@ class TransactionFactory
return;
}
// validate info:
$validator = \Validator::make(['iban' => $this->accountInformation['iban']], [
$validator = Validator::make(['iban' => $this->accountInformation['iban']], [
'iban' => ['required', new UniqueIban($this->account, $this->account->accountType->type)],
]);
if ($validator->fails()) {

View File

@@ -476,7 +476,7 @@ class TransactionJournalFactory
*/
private function getCurrency(?TransactionCurrency $currency, Account $account): TransactionCurrency
{
Log::debug(sprintf('Now in getCurrency(#%d, "%s")', $currency->id, $account->name));
Log::debug(sprintf('Now in getCurrency(#%d, "%s")', $currency?->id, $account->name));
/** @var null|TransactionCurrency $preference */
$preference = $this->accountRepository->getAccountCurrency($account);

View File

@@ -54,8 +54,8 @@ use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\User;
use Illuminate\Auth\Events\Login;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Notification;
use Mail;
/**
* Class UserEventHandler.
@@ -266,7 +266,7 @@ class UserEventHandler
$url = route('profile.confirm-email-change', [$token->data]);
try {
\Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url));
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url));
} catch (\Exception $e) {
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
@@ -291,7 +291,7 @@ class UserEventHandler
$url = route('profile.undo-email-change', [$token->data, $hashed]);
try {
\Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url));
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url));
} catch (\Exception $e) {
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
@@ -355,7 +355,7 @@ class UserEventHandler
$url = route('invite', [$event->invitee->invite_code]);
try {
\Mail::to($invitee)->send(new InvitationMail($invitee, $admin, $url));
Mail::to($invitee)->send(new InvitationMail($invitee, $admin, $url));
} catch (\Exception $e) {
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());

View File

@@ -73,7 +73,7 @@ class VersionCheckEventHandler
$diff = $now - $lastCheckTime->data;
Log::debug(sprintf('Last check time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff));
if ($diff < 604800) {
Log::debug(sprintf('Checked for updates less than a week ago (on %s).', \Safe\date('Y-m-d H:i:s', $lastCheckTime->data)));
Log::debug(sprintf('Checked for updates less than a week ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data)));
return;
}
@@ -105,7 +105,7 @@ class VersionCheckEventHandler
$diff = $now - $lastCheckTime->data;
Log::debug(sprintf('Last warning time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff));
if ($diff < 604800 * 4) {
Log::debug(sprintf('Warned about updates less than four weeks ago (on %s).', \Safe\date('Y-m-d H:i:s', $lastCheckTime->data)));
Log::debug(sprintf('Warned about updates less than four weeks ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data)));
return;
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Models\Location;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\AccountFormRequest;
@@ -87,11 +88,11 @@ class EditController extends Controller
$roles = $this->getRoles();
$liabilityTypes = $this->getLiabilityTypes();
$location = $repository->getLocation($account);
$latitude = null !== $location ? $location->latitude : config('firefly.default_location.latitude');
$longitude = null !== $location ? $location->longitude : config('firefly.default_location.longitude');
$zoomLevel = null !== $location ? $location->zoom_level : config('firefly.default_location.zoom_level');
$latitude = $location instanceof Location ? $location->latitude : config('firefly.default_location.latitude');
$longitude = $location instanceof Location ? $location->longitude : config('firefly.default_location.longitude');
$zoomLevel = $location instanceof Location ? $location->zoom_level : config('firefly.default_location.zoom_level');
$canEditCurrency = 0 === $account->piggyBanks()->count();
$hasLocation = null !== $location;
$hasLocation = $location instanceof Location;
$locations = [
'location' => [
'latitude' => old('location_latitude') ?? $latitude,

View File

@@ -94,7 +94,7 @@ class ReconcileController extends Controller
// get start and end
if (null === $start && null === $end) {
if (!$start instanceof Carbon && !$end instanceof Carbon) {
/** @var Carbon $start */
$start = clone session('start', app('navigation')->startOfPeriod(new Carbon(), $range));

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin;
use Carbon\Carbon;
use FireflyIII\Helpers\Update\UpdateTrait;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser;
@@ -96,7 +97,7 @@ class UpdateController extends Controller
$channel = in_array($channel, ['stable', 'beta', 'alpha'], true) ? $channel : 'stable';
app('fireflyconfig')->set('permission_update_check', $checkForUpdates);
app('fireflyconfig')->set('last_update_check', time());
app('fireflyconfig')->set('last_update_check', Carbon::now()->getTimestamp());
app('fireflyconfig')->set('update_channel', $channel);
session()->flash('success', (string) trans('firefly.configuration_updated'));

View File

@@ -34,6 +34,8 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use function Safe\parse_url;
/**
* Class ForgotPasswordController
*/
@@ -101,7 +103,7 @@ class ForgotPasswordController extends Controller
*/
private function validateHost(): void
{
$configuredHost = \Safe\parse_url((string) config('app.url'), PHP_URL_HOST);
$configuredHost = parse_url((string) config('app.url'), PHP_URL_HOST);
if (false === $configuredHost || null === $configuredHost) {
throw new FireflyException('Please set a valid and correct Firefly III URL in the APP_URL environment variable.');
}

View File

@@ -23,7 +23,9 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Auth;
use Cookie;
use Carbon\Carbon;
use FireflyIII\User;
use Illuminate\Support\Facades\Cookie;
use FireflyIII\Events\ActuallyLoggedIn;
use FireflyIII\Events\Security\UnknownUserAttemptedLogin;
use FireflyIII\Events\Security\UserAttemptedLogin;
@@ -44,6 +46,7 @@ use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpFoundation\Response as ResponseAlias;
/**
* Class LoginController
@@ -130,11 +133,11 @@ class LoginController extends Controller
app('log')->warning('Login attempt failed.');
$username = (string) $request->get($this->username());
$user = $this->repository->findByEmail($username);
if (null === $user) {
if (!$user instanceof User) {
// send event to owner.
event(new UnknownUserAttemptedLogin($username));
}
if (null !== $user) {
if ($user instanceof User) {
event(new UserAttemptedLogin($user));
}
@@ -198,7 +201,7 @@ class LoginController extends Controller
// also logout current 2FA tokens.
$cookieName = config('google2fa.cookie_name', 'google2fa_token');
\Cookie::forget($cookieName);
Cookie::forget($cookieName);
$this->guard()->logout();
@@ -209,7 +212,7 @@ class LoginController extends Controller
$this->loggedOut($request);
return $request->wantsJson()
? new Response('', 204)
? new Response('', ResponseAlias::HTTP_NO_CONTENT)
: redirect('/');
}
@@ -220,7 +223,7 @@ class LoginController extends Controller
*
* @throws FireflyException
*/
public function showLoginForm(Request $request)
public function showLoginForm(?Request $request = null)
{
Log::channel('audit')->info('Show login form (1.1).');
@@ -246,13 +249,13 @@ class LoginController extends Controller
$allowReset = false;
}
$email = $request->old('email');
$remember = $request->old('remember');
$email = $request?->old('email');
$remember = $request?->old('remember');
$storeInCookie = config('google2fa.store_in_cookie', false);
if (false !== $storeInCookie) {
$cookieName = config('google2fa.cookie_name', 'google2fa_token');
\Cookie::queue(\Cookie::make($cookieName, 'invalid-'.time()));
Cookie::queue(Cookie::make($cookieName, 'invalid-'.Carbon::now()->getTimestamp()));
}
$usernameField = $this->username();

View File

@@ -130,7 +130,7 @@ class RegisterController extends Controller
$allowRegistration = false;
}
if ('web' !== $guard) {
$allowRegistration = false;
return false;
}
return $allowRegistration;
@@ -175,7 +175,7 @@ class RegisterController extends Controller
*
* @throws FireflyException
*/
public function showRegistrationForm(Request $request)
public function showRegistrationForm(?Request $request = null)
{
$isDemoSite = app('fireflyconfig')->get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
$pageTitle = (string) trans('firefly.register_page_title');
@@ -187,7 +187,7 @@ class RegisterController extends Controller
return view('error', compact('message'));
}
$email = $request->old('email');
$email = $request?->old('email');
return view('auth.register', compact('isDemoSite', 'email', 'pageTitle'));
}

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Auth;
use Carbon\Carbon;
use FireflyIII\Events\Security\MFABackupFewLeft;
use FireflyIII\Events\Security\MFABackupNoLeft;
use FireflyIII\Events\Security\MFAManyFailedAttempts;
@@ -129,7 +130,7 @@ class TwoFactorController extends Controller
*/
private function inMFAHistory(string $mfaCode, array $mfaHistory): bool
{
$now = time();
$now = Carbon::now()->getTimestamp();
foreach ($mfaHistory as $entry) {
$time = $entry['time'];
$code = $entry['code'];
@@ -149,7 +150,7 @@ class TwoFactorController extends Controller
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$newHistory = [];
$now = time();
$now = Carbon::now()->getTimestamp();
foreach ($mfaHistory as $entry) {
$time = $entry['time'];
$code = $entry['code'];
@@ -184,7 +185,7 @@ class TwoFactorController extends Controller
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$entry = [
'time' => time(),
'time' => Carbon::now()->getTimestamp(),
'code' => $mfaCode,
];
$mfaHistory[] = $entry;

View File

@@ -143,13 +143,13 @@ class BudgetLimitController extends Controller
// first search for existing one and update it if necessary.
$currency = $this->currencyRepos->find((int) $request->get('transaction_currency_id'));
$budget = $this->repository->find((int) $request->get('budget_id'));
if (null === $currency || null === $budget) {
if (!$currency instanceof TransactionCurrency || !$budget instanceof Budget) {
throw new FireflyException('No valid currency or budget.');
}
$start = Carbon::createFromFormat('Y-m-d', $request->get('start'));
$end = Carbon::createFromFormat('Y-m-d', $request->get('end'));
if (null === $start || null === $end) {
if (!$start instanceof Carbon || !$end instanceof Carbon) {
return response()->json([]);
}
@@ -167,7 +167,7 @@ class BudgetLimitController extends Controller
// sanity check on amount:
if (0 === bccomp($amount, '0')) {
if (null !== $limit) {
if ($limit instanceof BudgetLimit) {
$this->blRepository->destroyBudgetLimit($limit);
}
@@ -181,11 +181,11 @@ class BudgetLimitController extends Controller
$amount = bcmul($amount, '-1');
}
if (null !== $limit) {
if ($limit instanceof BudgetLimit) {
$limit->amount = $amount;
$limit->save();
}
if (null === $limit) {
if (!$limit instanceof BudgetLimit) {
$limit = $this->blRepository->store(
[
'budget_id' => $request->get('budget_id'),

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Models\AutoBudget;
use FireflyIII\Enums\AutoBudgetType;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
@@ -95,7 +96,7 @@ class EditController extends Controller
'active' => $hasOldInput ? (bool) $request->old('active') : $budget->active,
'auto_budget_currency_id' => $hasOldInput ? (int) $request->old('auto_budget_currency_id') : $this->defaultCurrency->id,
];
if (null !== $autoBudget) {
if ($autoBudget instanceof AutoBudget) {
$amount = $hasOldInput ? $request->old('auto_budget_amount') : $autoBudget->amount;
if (is_array($amount)) {
$amount = '0';

View File

@@ -316,7 +316,7 @@ class IndexController extends Controller
foreach ($budgetIds as $index => $budgetId) {
$budgetId = (int) $budgetId;
$budget = $repository->find($budgetId);
if (null !== $budget) {
if ($budget instanceof Budget) {
app('log')->debug(sprintf('Set budget #%d ("%s") to position %d', $budget->id, $budget->name, $index + 1));
$repository->setBudgetOrder($budget, $index + 1);
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Models\TransactionJournal;
use Carbon\Carbon;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\FireflyException;
@@ -90,7 +91,7 @@ class ShowController extends Controller
// get first journal ever to set off the budget period overview.
$first = $this->journalRepos->firstNull();
$firstDate = null !== $first ? $first->date : $start;
$firstDate = $first instanceof TransactionJournal ? $first->date : $start;
$periods = $this->getNoBudgetPeriodOverview($firstDate, $end);
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
@@ -115,7 +116,7 @@ class ShowController extends Controller
{
$subTitle = (string) trans('firefly.all_journals_without_budget');
$first = $this->journalRepos->firstNull();
$start = null === $first ? new Carbon() : $first->date;
$start = $first instanceof TransactionJournal ? $first->date : new Carbon();
$end = today(config('app.timezone'));
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Models\TransactionJournal;
use Carbon\Carbon;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\FireflyException;
@@ -119,7 +120,7 @@ class NoCategoryController extends Controller
app('log')->debug('Start of noCategory()');
$subTitle = (string) trans('firefly.all_journals_without_category');
$first = $this->journalRepos->firstNull();
$start = null === $first ? new Carbon() : $first->date;
$start = $first instanceof TransactionJournal ? $first->date : new Carbon();
$end = today(config('app.timezone'));
app('log')->debug(sprintf('Start for noCategory() is %s', $start->format('Y-m-d')));
app('log')->debug(sprintf('End for noCategory() is %s', $end->format('Y-m-d')));

View File

@@ -43,6 +43,8 @@ use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use function Safe\json_encode;
/**
* Class AccountController.
*/
@@ -468,14 +470,14 @@ class AccountController extends Controller
Log::debug('Balances exist at:');
foreach ($range as $key => $value) {
$newRange[] = ['date' => $key, 'info' => $value];
Log::debug(sprintf('%d - %s (%s)', count($newRange) - 1, $key, \Safe\json_encode($value)));
Log::debug(sprintf('%d - %s (%s)', count($newRange) - 1, $key, json_encode($value)));
}
$carbon = Carbon::createFromFormat('Y-m-d', $newRange[0]['date'])->endOfDay();
Log::debug(sprintf('Start of loop, $carbon is %s', $carbon->format('Y-m-d H:i:s')));
while ($end->gte($current)) {
$momentBalance = $previous;
// $theDate = $current->format('Y-m-d');
Log::debug(sprintf('Now at %s, with momentBalance %s', $current->format('Y-m-d H:i:s'), \Safe\json_encode($momentBalance)));
Log::debug(sprintf('Now at %s, with momentBalance %s', $current->format('Y-m-d H:i:s'), json_encode($momentBalance)));
// loop over the array with balances, find one that is earlier or on the same day.
while ($carbon->lte($current) && array_key_exists($expectedIndex, $newRange)) {
@@ -490,7 +492,7 @@ class AccountController extends Controller
$carbon = Carbon::createFromFormat('Y-m-d', $newRange[$expectedIndex]['date'])->endOfDay();
}
}
Log::debug(sprintf('momentBalance is now %s', \Safe\json_encode($momentBalance)));
Log::debug(sprintf('momentBalance is now %s', json_encode($momentBalance)));
$return = $this->updateChartKeys($return, $momentBalance);
$previous = $momentBalance;

View File

@@ -202,7 +202,7 @@ class BudgetController extends Controller
{
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$budgetLimitId = null === $budgetLimit ? 0 : $budgetLimit->id;
$budgetLimitId = $budgetLimit instanceof BudgetLimit ? $budgetLimit->id : 0;
$cache = new CacheProperties();
$cache->addProperty($budget->id);
$cache->addProperty($this->convertToNative);
@@ -211,7 +211,7 @@ class BudgetController extends Controller
$start = session('first', today(config('app.timezone'))->startOfYear());
$end = today();
if (null !== $budgetLimit) {
if ($budgetLimit instanceof BudgetLimit) {
$start = $budgetLimit->start_date;
$end = $budgetLimit->end_date;
$collector->setRange($budgetLimit->start_date, $budgetLimit->end_date)->setNormalCurrency($budgetLimit->transactionCurrency);
@@ -285,7 +285,7 @@ class BudgetController extends Controller
{
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$budgetLimitId = null === $budgetLimit ? 0 : $budgetLimit->id;
$budgetLimitId = $budgetLimit instanceof BudgetLimit ? $budgetLimit->id : 0;
$cache = new CacheProperties();
$cache->addProperty($budget->id);
$cache->addProperty($this->convertToNative);
@@ -293,7 +293,7 @@ class BudgetController extends Controller
$cache->addProperty('chart.budget.expense-category');
$start = session('first', today(config('app.timezone'))->startOfYear());
$end = today();
if (null !== $budgetLimit) {
if ($budgetLimit instanceof BudgetLimit) {
$start = $budgetLimit->start_date;
$end = $budgetLimit->end_date;
$collector->setNormalCurrency($budgetLimit->transactionCurrency);
@@ -367,7 +367,7 @@ class BudgetController extends Controller
{
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$budgetLimitId = null === $budgetLimit ? 0 : $budgetLimit->id;
$budgetLimitId = $budgetLimit instanceof BudgetLimit ? $budgetLimit->id : 0;
$cache = new CacheProperties();
$cache->addProperty($budget->id);
$cache->addProperty($budgetLimitId);
@@ -375,7 +375,7 @@ class BudgetController extends Controller
$cache->addProperty('chart.budget.expense-expense');
$start = session('first', today(config('app.timezone'))->startOfYear());
$end = today();
if (null !== $budgetLimit) {
if ($budgetLimit instanceof BudgetLimit) {
$start = $budgetLimit->start_date;
$end = $budgetLimit->end_date;
$collector->setRange($budgetLimit->start_date, $budgetLimit->end_date)->setNormalCurrency($budgetLimit->transactionCurrency);
@@ -529,7 +529,7 @@ class BudgetController extends Controller
// get budget limit in this period for this currency.
$limit = $this->blRepository->find($budget, $currency, $currentStart, $currentEnd);
if (null !== $limit) {
if ($limit instanceof BudgetLimit) {
$chartData[1]['entries'][$title] = app('steam')->bcround($limit->amount, $currency->decimal_places);
}

View File

@@ -159,7 +159,7 @@ class CategoryController extends Controller
$income = [];
$expenses = [];
$categoryId = 0;
if (null === $category) {
if (!$category instanceof Category) {
/** @var NoCategoryRepositoryInterface $noCatRepository */
$noCatRepository = app(NoCategoryRepositoryInterface::class);
@@ -168,7 +168,7 @@ class CategoryController extends Controller
$income = $noCatRepository->listIncome($start, $end, $accounts);
}
if (null !== $category) {
if ($category instanceof Category) {
/** @var OperationsRepositoryInterface $opsRepository */
$opsRepository = app(OperationsRepositoryInterface::class);
$categoryId = $category->id;

View File

@@ -23,6 +23,8 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use function Safe\realpath;
use function Safe\ini_get;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Support\Facades\Amount;
use FireflyIII\Support\Facades\Steam;
@@ -34,7 +36,7 @@ use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\View;
use Route;
use Illuminate\Support\Facades\Route;
/**
* Class Controller.
@@ -83,15 +85,15 @@ abstract class Controller extends BaseController
if ('true' === request()->get('force_default_layout') && 'v2' === config('view.layout')) {
//config('view.layout','v1');
Config::set('view.layout', 'v1');
View::getFinder()->setPaths([\Safe\realpath(base_path('resources/views'))]); // @phpstan-ignore-line
View::getFinder()->setPaths([realpath(base_path('resources/views'))]); // @phpstan-ignore-line
}
View::share('authGuard', $authGuard);
View::share('logoutUrl', $logoutUrl);
// upload size
$maxFileSize = Steam::phpBytes((string) \Safe\ini_get('upload_max_filesize'));
$maxPostSize = Steam::phpBytes((string) \Safe\ini_get('post_max_size'));
$maxFileSize = Steam::phpBytes((string) ini_get('upload_max_filesize'));
$maxPostSize = Steam::phpBytes((string) ini_get('post_max_size'));
$uploadSize = min($maxFileSize, $maxPostSize);
View::share('uploadSize', $uploadSize);

View File

@@ -50,6 +50,9 @@ use Illuminate\View\View;
use Monolog\Handler\RotatingFileHandler;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use function Safe\file_get_contents;
use function Safe\ini_get;
/**
* Class DebugController
*/
@@ -139,7 +142,7 @@ class DebugController extends Controller
if ($handler instanceof RotatingFileHandler) {
$logFile = $handler->getUrl();
if (null !== $logFile && file_exists($logFile)) {
$logContent = \Safe\file_get_contents($logFile);
$logContent = file_get_contents($logFile);
}
}
}
@@ -164,8 +167,8 @@ class DebugController extends Controller
private function getSystemInformation(): array
{
$maxFileSize = Steam::phpBytes((string) \Safe\ini_get('upload_max_filesize'));
$maxPostSize = Steam::phpBytes((string) \Safe\ini_get('post_max_size'));
$maxFileSize = Steam::phpBytes((string) ini_get('upload_max_filesize'));
$maxPostSize = Steam::phpBytes((string) ini_get('post_max_size'));
$drivers = DB::availableDrivers();
$currentDriver = DB::getDriverName();
@@ -177,8 +180,8 @@ class DebugController extends Controller
'interface' => \PHP_SAPI,
'bits' => \PHP_INT_SIZE * 8,
'bcscale' => bcscale(),
'display_errors' => \Safe\ini_get('display_errors'),
'error_reporting' => $this->errorReporting((int) \Safe\ini_get('error_reporting')),
'display_errors' => ini_get('display_errors'),
'error_reporting' => $this->errorReporting((int) ini_get('error_reporting')),
'upload_size' => min($maxFileSize, $maxPostSize),
'all_drivers' => $drivers,
'current_driver' => $currentDriver,
@@ -197,7 +200,7 @@ class DebugController extends Controller
try {
if (file_exists('/var/www/counter-main.txt')) {
$return['build'] = trim((string) \Safe\file_get_contents('/var/www/counter-main.txt'));
$return['build'] = trim((string) file_get_contents('/var/www/counter-main.txt'));
app('log')->debug(sprintf('build is now "%s"', $return['build']));
}
} catch (\Exception $e) {
@@ -207,7 +210,7 @@ class DebugController extends Controller
try {
if (file_exists('/var/www/build-date-main.txt')) {
$return['build_date'] = trim((string) \Safe\file_get_contents('/var/www/build-date-main.txt'));
$return['build_date'] = trim((string) file_get_contents('/var/www/build-date-main.txt'));
}
} catch (\Exception $e) {
app('log')->debug('Could not check build date, but thats ok.');

View File

@@ -24,6 +24,8 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Export;
use Carbon\Carbon;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser;
@@ -84,14 +86,14 @@ class IndexController extends Controller
$firstDate = today(config('app.timezone'));
$firstDate->subYear();
$journal = $this->journalRepository->firstNull();
if (null !== $journal) {
if ($journal instanceof TransactionJournal) {
Log::debug('First journal is NULL, using today() - 1 year.');
$firstDate = clone $journal->date;
}
$generator->setStart($firstDate);
$result = $generator->export();
$name = sprintf('%s_transaction_export.csv', \Safe\date('Y_m_d'));
$name = sprintf('%s_transaction_export.csv', Carbon::now()->format('Y_m_d'));
$quoted = sprintf('"%s"', addcslashes($name, '"\\'));
// headers for CSV file.

View File

@@ -96,7 +96,7 @@ class JavascriptController extends Controller
{
$account = $repository->find((int) $request->get('account'));
$currency = $this->defaultCurrency;
if (null !== $account) {
if ($account instanceof Account) {
$currency = $repository->getAccountCurrency($account) ?? $this->defaultCurrency;
}
$locale = app('steam')->getLocale();

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Json;
use FireflyIII\Models\AvailableBudget;
use Carbon\Carbon;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\TransactionCurrency;
@@ -72,7 +73,7 @@ class BudgetController extends Controller
$available = '0';
$percentage = '0';
if (null !== $availableBudget) {
if ($availableBudget instanceof AvailableBudget) {
$available = $availableBudget->amount;
if (0 !== bccomp($available, '0')) {
$percentage = bcmul(bcdiv($budgeted, $available), '100');

View File

@@ -77,7 +77,7 @@ class ReconcileController extends Controller
$amount = '0';
$clearedAmount = '0';
if (null === $start && null === $end) {
if (!$start instanceof Carbon && !$end instanceof Carbon) {
throw new FireflyException('Invalid dates submitted.');
}
if ($end->lt($start)) {
@@ -183,7 +183,7 @@ class ReconcileController extends Controller
*/
public function transactions(Account $account, ?Carbon $start = null, ?Carbon $end = null)
{
if (null === $start || null === $end) {
if (!$start instanceof Carbon || !$end instanceof Carbon) {
throw new FireflyException('Invalid dates submitted.');
}
if ($end->lt($start)) {

View File

@@ -82,12 +82,12 @@ class RecurrenceController extends Controller
$skip = $skip < 0 || $skip > 31 ? 0 : $skip;
$weekend = $weekend < 1 || $weekend > 4 ? 1 : $weekend;
if (null === $endDate) {
if (!$endDate instanceof Carbon) {
// safety catch:
$endDate = now()->addYear();
}
if (null === $start || null === $end || null === $firstDate) {
if (!$start instanceof Carbon || !$end instanceof Carbon || !$firstDate instanceof Carbon) {
return response()->json();
}
@@ -153,7 +153,7 @@ class RecurrenceController extends Controller
*/
public function suggest(Request $request): JsonResponse
{
$string = '' === (string) $request->get('date') ? \Safe\date('Y-m-d') : (string) $request->get('date');
$string = '' === (string) $request->get('date') ? Carbon::now()->format('Y-m-d') : (string) $request->get('date');
$today = today(config('app.timezone'))->startOfDay();
try {
@@ -161,7 +161,7 @@ class RecurrenceController extends Controller
} catch (InvalidFormatException) {
$date = Carbon::today(config('app.timezone'));
}
if (null === $date) {
if (!$date instanceof Carbon) {
return response()->json();
}
$date->startOfDay();

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Requests\NewUserFormRequest;
@@ -101,7 +102,7 @@ class NewUserController extends Controller
$currency = $currencyRepository->find((int) $request->input('amount_currency_id_bank_balance'));
// if is null, set to EUR:
if (null === $currency) {
if (!$currency instanceof TransactionCurrency) {
$currency = $currencyRepository->findByCode('EUR');
}
$currencyRepository->enable($currency);

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use Carbon\Carbon;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Events\Preferences\UserGroupChangedDefaultCurrency;
use FireflyIII\Events\Test\UserTestNotificationChannel;
@@ -40,6 +41,10 @@ use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use function Safe\json_decode;
use function Safe\file_get_contents;
use function Safe\strtotime;
/**
* Class PreferencesController.
*/
@@ -110,7 +115,7 @@ class PreferencesController extends Controller
if (is_array($fiscalYearStartStr)) {
$fiscalYearStartStr = '01-01';
}
$fiscalYearStart = sprintf('%s-%s', \Safe\date('Y'), (string) $fiscalYearStartStr);
$fiscalYearStart = sprintf('%s-%s', Carbon::now()->format('Y'), (string) $fiscalYearStartStr);
$tjOptionalFields = Preferences::get('transaction_journal_optional_fields', [])->data;
$availableDarkModes = config('firefly.available_dark_modes');
@@ -149,7 +154,7 @@ class PreferencesController extends Controller
// list of locales also has "equal" which makes it equal to whatever the language is.
try {
$locales = \Safe\json_decode((string) \Safe\file_get_contents(resource_path(sprintf('locales/%s/locales.json', $language))), true, 512, JSON_THROW_ON_ERROR);
$locales = json_decode((string) file_get_contents(resource_path(sprintf('locales/%s/locales.json', $language))), true, 512, JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
app('log')->error($e->getMessage());
$locales = [];
@@ -271,9 +276,9 @@ class PreferencesController extends Controller
// custom fiscal year
$customFiscalYear = 1 === (int) $request->get('customFiscalYear');
$string = \Safe\strtotime((string) $request->get('fiscalYearStart'));
$string = strtotime((string) $request->get('fiscalYearStart'));
if (false !== $string) {
$fiscalYearStart = \Safe\date('m-d', $string);
$fiscalYearStart = Carbon::createFromTimestamp($string)->format('m-d');
Preferences::set('customFiscalYear', $customFiscalYear);
Preferences::set('fiscalYearStart', $fiscalYearStart);
}

View File

@@ -24,6 +24,9 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Profile;
use Illuminate\Support\Facades\Cookie;
use PragmaRX\Google2FALaravel\Facade as Google2FA;
use Carbon\Carbon;
use FireflyIII\Events\Security\DisabledMFA;
use FireflyIII\Events\Security\EnabledMFA;
use FireflyIII\Events\Security\MFANewBackupCodes;
@@ -181,7 +184,7 @@ class MfaController extends Controller
// also logout current 2FA tokens.
$cookieName = config('google2fa.cookie_name', 'google2fa_token');
\Cookie::forget($cookieName);
Cookie::forget($cookieName);
// send user notification.
Log::channel('audit')->info(sprintf('User "%s" has disabled MFA', $user->email));
@@ -214,8 +217,8 @@ class MfaController extends Controller
}
$domain = $this->getDomain();
$secret = \Google2FA::generateSecretKey();
$image = \Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret);
$secret = Google2FA::generateSecretKey();
$image = Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret);
app('preferences')->set('temp-mfa-secret', $secret);
@@ -271,7 +274,7 @@ class MfaController extends Controller
// make sure MFA is logged out.
if ('testing' !== config('app.env')) {
\Google2FA::logout();
Google2FA::logout();
}
// drop all info from session:
@@ -294,7 +297,7 @@ class MfaController extends Controller
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$entry = [
'time' => time(),
'time' => Carbon::now()->getTimestamp(),
'code' => $mfaCode,
];
$mfaHistory[] = $entry;
@@ -311,7 +314,7 @@ class MfaController extends Controller
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$newHistory = [];
$now = time();
$now = Carbon::now()->getTimestamp();
foreach ($mfaHistory as $entry) {
$time = $entry['time'];
$code = $entry['code'];

View File

@@ -23,6 +23,8 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use FireflyIII\Events\UserChangedEmail;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Exceptions\ValidationException;
@@ -154,7 +156,8 @@ class ProfileController extends Controller
if (0 === $count) {
/** @var ClientRepository $repository */
$repository = app(ClientRepository::class);
$repository->createPersonalAccessClient(null, config('app.name').' Personal Access Client', 'http://localhost');
$name = sprintf('%s Personal Access Grant Client', config('app.name'));
$repository->createPersonalAccessClient(null, $name, 'http://localhost');
}
$accessToken = app('preferences')->get('access_token');
@@ -201,9 +204,9 @@ class ProfileController extends Controller
return redirect(route('profile.change-email'))->withInput();
}
$existing = $repository->findByEmail($newEmail);
if (null !== $existing) {
if ($existing instanceof User) {
// force user logout.
\Auth::guard()->logout(); // @phpstan-ignore-line (does not recognize function)
Auth::guard()->logout(); // @phpstan-ignore-line (does not recognize function)
$request->session()->invalidate();
session()->flash('success', (string) trans('firefly.email_changed'));
@@ -217,7 +220,7 @@ class ProfileController extends Controller
event(new UserChangedEmail($user, $newEmail, $oldEmail));
// force user logout.
\Auth::guard()->logout(); // @phpstan-ignore-line (does not recognize function)
Auth::guard()->logout(); // @phpstan-ignore-line (does not recognize function)
$request->session()->invalidate();
session()->flash('success', (string) trans('firefly.email_changed'));
@@ -310,7 +313,7 @@ class ProfileController extends Controller
return redirect(route('profile.index'));
}
if (!\Hash::check($request->get('password'), auth()->user()->password)) {
if (!Hash::check($request->get('password'), auth()->user()->password)) {
session()->flash('error', (string) trans('firefly.invalid_password'));
return redirect(route('profile.delete-account'));
@@ -343,8 +346,8 @@ class ProfileController extends Controller
'email' => auth()->user()->email,
'password' => $request->get('password'),
];
if (\Auth::once($creds)) {
\Auth::logoutOtherDevices($request->get('password'));
if (Auth::once($creds)) {
Auth::logoutOtherDevices($request->get('password'));
session()->flash('info', (string) trans('firefly.other_sessions_logged_out'));
return redirect(route('profile.index'));

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Rule;
use FireflyIII\Models\Rule;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\RuleFormRequest;
@@ -128,7 +129,7 @@ class CreateController extends Controller
// title depends on whether or not there is a rule group:
$subTitle = (string) trans('firefly.make_new_rule_no_group');
if (null !== $ruleGroup) {
if ($ruleGroup instanceof RuleGroup) {
$subTitle = (string) trans('firefly.make_new_rule', ['title' => $ruleGroup->title]);
}
@@ -252,7 +253,7 @@ class CreateController extends Controller
{
$ruleId = (int) $request->get('id');
$rule = $this->ruleRepos->find($ruleId);
if (null !== $rule) {
if ($rule instanceof Rule) {
$this->ruleRepos->duplicate($rule);
}

View File

@@ -91,7 +91,7 @@ class EditController extends Controller
{
$groupId = (int) $request->get('id');
$ruleGroup = $this->repository->find($groupId);
if (null !== $ruleGroup) {
if ($ruleGroup instanceof RuleGroup) {
$direction = $request->get('direction');
if ('down' === $direction) {
$maxOrder = $this->repository->maxOrder();

View File

@@ -24,7 +24,8 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\System;
use Cache;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Cache;
use Exception;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
@@ -36,6 +37,8 @@ use Illuminate\View\View;
use Laravel\Passport\Passport;
use phpseclib3\Crypt\RSA;
use function Safe\file_put_contents;
/**
* Class InstallController
*/
@@ -140,14 +143,14 @@ class InstallController extends Controller
$this->keys();
}
if ('generate-keys' !== $command) {
\Artisan::call($command, $args);
app('log')->debug(\Artisan::output());
Artisan::call($command, $args);
app('log')->debug(Artisan::output());
}
} catch (\Exception $e) { // intentional generic exception
throw new FireflyException($e->getMessage(), 0, $e);
}
// clear cache as well.
\Cache::clear();
Cache::clear();
app('preferences')->mark();
return true;
@@ -169,7 +172,7 @@ class InstallController extends Controller
return;
}
\Safe\file_put_contents($publicKey, (string) $key->getPublicKey());
\Safe\file_put_contents($privateKey, $key->toString('PKCS1'));
file_put_contents($publicKey, (string) $key->getPublicKey());
file_put_contents($privateKey, $key->toString('PKCS1'));
}
}

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use FireflyIII\Models\Location;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -124,10 +125,10 @@ class TagController extends Controller
$subTitleIcon = 'fa-tag';
$location = $this->repository->getLocation($tag);
$latitude = null !== $location ? $location->latitude : config('firefly.default_location.latitude');
$longitude = null !== $location ? $location->longitude : config('firefly.default_location.longitude');
$zoomLevel = null !== $location ? $location->zoom_level : config('firefly.default_location.zoom_level');
$hasLocation = null !== $location;
$latitude = $location instanceof Location ? $location->latitude : config('firefly.default_location.latitude');
$longitude = $location instanceof Location ? $location->longitude : config('firefly.default_location.longitude');
$zoomLevel = $location instanceof Location ? $location->zoom_level : config('firefly.default_location.zoom_level');
$hasLocation = $location instanceof Location;
$locations = [
'location' => [
'latitude' => old('location_latitude') ?? $latitude,
@@ -155,8 +156,8 @@ class TagController extends Controller
{
// start with oldest tag
$first = session('first', today()) ?? today();
$oldestTagDate = null === $repository->oldestTag() ? clone $first : $repository->oldestTag()->date;
$newestTagDate = null === $repository->newestTag() ? today() : $repository->newestTag()->date;
$oldestTagDate = $repository->oldestTag() instanceof Tag ? $repository->oldestTag()->date : clone $first;
$newestTagDate = $repository->newestTag() instanceof Tag ? $repository->newestTag()->date : today();
$oldestTagDate->startOfYear();
$newestTagDate->endOfYear();
$tags = [];
@@ -184,7 +185,7 @@ class TagController extends Controller
foreach ($tags as $tagId) {
$tagId = (int) $tagId;
$tag = $this->repository->find($tagId);
if (null !== $tag) {
if ($tag instanceof Tag) {
$this->repository->destroy($tag);
++$count;
}

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Models\TransactionCurrency;
use Exception;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Enums\TransactionTypeEnum;
@@ -342,7 +343,7 @@ class ConvertController extends Controller
$sourceCurrency = $this->accountRepository->getAccountCurrency($source);
$dest = $this->accountRepository->find((int) $destinationId);
$destCurrency = $this->accountRepository->getAccountCurrency($dest);
if (null !== $sourceCurrency && null !== $destCurrency && $sourceCurrency->code !== $destCurrency->code) {
if ($sourceCurrency instanceof TransactionCurrency && $destCurrency instanceof TransactionCurrency && $sourceCurrency->code !== $destCurrency->code) {
$update['currency_id'] = $sourceCurrency->id;
$update['foreign_currency_id'] = $destCurrency->id;
$update['foreign_amount'] = '1'; // not the best solution but at this point the amount is hard to get.

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Events\StoredTransactionGroup;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
@@ -35,6 +36,8 @@ use Illuminate\Contracts\View\View;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use function Safe\parse_url;
/**
* Class CreateController
*/
@@ -65,7 +68,7 @@ class CreateController extends Controller
$groupId = (int) $request->get('id');
if (0 !== $groupId) {
$group = $this->repository->find($groupId);
if (null !== $group) {
if ($group instanceof TransactionGroup) {
/** @var GroupCloneService $service */
$service = app(GroupCloneService::class);
$newGroup = $service->cloneGroup($group);
@@ -116,7 +119,7 @@ class CreateController extends Controller
$accountToTypes = config('firefly.account_to_transaction');
$defaultCurrency = $this->defaultCurrency;
$previousUrl = $this->rememberPreviousUrl('transactions.create.url');
$parts = \Safe\parse_url($previousUrl);
$parts = parse_url((string) $previousUrl);
$search = sprintf('?%s', $parts['query'] ?? '');
$previousUrl = str_replace($search, '', $previousUrl);
if (!is_array($optionalFields)) {

View File

@@ -35,6 +35,8 @@ use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use function Safe\parse_url;
/**
* Class EditController
*/
@@ -85,7 +87,7 @@ class EditController extends Controller
$defaultCurrency = $this->defaultCurrency;
$cash = $repository->getCashAccount();
$previousUrl = $this->rememberPreviousUrl('transactions.edit.url');
$parts = \Safe\parse_url($previousUrl);
$parts = parse_url((string) $previousUrl);
$search = sprintf('?%s', $parts['query'] ?? '');
$previousUrl = str_replace($search, '', $previousUrl);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Models\TransactionJournal;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
@@ -81,14 +82,14 @@ class IndexController extends Controller
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
if (null === $start) {
if (!$start instanceof Carbon) {
$start = session('start');
$end = session('end');
}
if (null === $end) {
// get last transaction ever?
$last = $this->repository->getLast();
$end = null !== $last ? $last->date : session('end');
$end = $last instanceof TransactionJournal ? $last->date : session('end');
}
[$start, $end] = $end < $start ? [$end, $start] : [$start, $end];
@@ -97,7 +98,7 @@ class IndexController extends Controller
$subTitle = (string) trans(sprintf('firefly.title_%s_between', $objectType), ['start' => $startStr, 'end' => $endStr]);
$path = route('transactions.index', [$objectType, $start->format('Y-m-d'), $end->format('Y-m-d')]);
$firstJournal = $this->repository->firstNull();
$startPeriod = null === $firstJournal ? new Carbon() : $firstJournal->date;
$startPeriod = $firstJournal instanceof TransactionJournal ? $firstJournal->date : new Carbon();
$endPeriod = clone $end;
$periods = $this->getTransactionPeriodOverview($objectType, $startPeriod, $endPeriod);
@@ -132,9 +133,9 @@ class IndexController extends Controller
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$path = route('transactions.index.all', [$objectType]);
$first = $this->repository->firstNull();
$start = null === $first ? new Carbon() : $first->date;
$start = $first instanceof TransactionJournal ? $first->date : new Carbon();
$last = $this->repository->getLast();
$end = null !== $last ? $last->date : today(config('app.timezone'));
$end = $last instanceof TransactionJournal ? $last->date : today(config('app.timezone'));
$subTitle = (string) trans('firefly.all_'.$objectType);
/** @var GroupCollectorInterface $collector */

View File

@@ -113,7 +113,7 @@ class LinkController extends Controller
app('log')->debug('We are here (store)');
$other = $this->journalRepository->find($linkInfo['transaction_journal_id']);
if (null === $other) {
if (!$other instanceof TransactionJournal) {
session()->flash('error', (string) trans('firefly.invalid_link_selection'));
return redirect(route('transactions.show', [$journal->transaction_group_id]));

View File

@@ -191,7 +191,7 @@ class MassController extends Controller
private function updateJournal(int $journalId, MassEditJournalRequest $request): void
{
$journal = $this->repository->find($journalId);
if (null === $journal) {
if (!$journal instanceof TransactionJournal) {
throw new FireflyException(sprintf('Trying to edit non-existent or deleted journal #%d', $journalId));
}
$service = app(JournalUpdateService::class);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\TransactionCurrency;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\CurrencyFormRequest;
@@ -122,7 +123,7 @@ class CreateController extends Controller
}
$redirect = redirect($this->getPreviousUrl('currencies.create.url'));
if (null !== $currency) {
if ($currency instanceof TransactionCurrency) {
$request->session()->flash('success', (string) trans('firefly.created_currency', ['name' => $currency->name]));
Log::channel('audit')->info('Created (POST) currency.', $data);
if (1 === (int) $request->get('create_another')) {

View File

@@ -177,7 +177,7 @@ class Kernel extends HttpKernel
// full API authentication
'api' => [
AcceptHeaders::class,
// EnsureFrontendRequestsAreStateful::class,
EnsureFrontendRequestsAreStateful::class,
'auth:api,sanctum',
'bindings',
],

View File

@@ -29,6 +29,8 @@ use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use function Safe\preg_match;
class AcceptHeaders
{
/**
@@ -71,7 +73,7 @@ class AcceptHeaders
// throw bad request if trace id is not a UUID
$uuid = $request->header('X-Trace-Id');
if (is_string($uuid) && '' !== trim($uuid) && (1 !== \Safe\preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)))) {
if (is_string($uuid) && '' !== trim($uuid) && (1 !== preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)))) {
throw new BadRequestHttpException('Bad X-Trace-Id header.');
}

View File

@@ -114,10 +114,10 @@ class Authenticate
*/
private function validateBlockedUser(?User $user, array $guards): void
{
if (null === $user) {
if (!$user instanceof User) {
app('log')->warning('User is null, throw exception?');
}
if (null !== $user) {
if ($user instanceof User) {
// app('log')->debug(get_class($user));
if (1 === (int) $user->blocked) {
$message = (string) trans('firefly.block_account_logout');

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Middleware;
use Illuminate\Support\Facades\App;
use Carbon\Carbon;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Support\Facades\Amount;
@@ -101,7 +102,7 @@ class Range
// get locale preference:
$language = app('steam')->getLanguage();
$locale = app('steam')->getLocale();
\App::setLocale($language);
App::setLocale($language);
Carbon::setLocale(substr((string) $locale, 0, 2));
$localeArray = app('steam')->getLocaleArray($locale);

View File

@@ -70,7 +70,7 @@ class CurrencyFormRequest extends FormRequest
$currency = $this->route()->parameter('currency');
if (null !== $currency) {
$rules = [
return [
'name' => 'required|max:48|min:1',
'code' => 'required|min:3|max:51',
'symbol' => 'required|min:1|max:51',

View File

@@ -36,6 +36,8 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
use function Safe\preg_match;
/**
* Class CategoryFormRequest.
*/
@@ -143,7 +145,7 @@ class ReportFormRequest extends FormRequest
// validate as date
// if regex for YYYY-MM-DD:
$pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/';
$result = \Safe\preg_match($pattern, $string);
$result = preg_match($pattern, $string);
if (false !== $result && 0 !== $result) {
try {
$date = new Carbon($parts[1]);
@@ -181,7 +183,7 @@ class ReportFormRequest extends FormRequest
// validate as date
// if regex for YYYY-MM-DD:
$pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/';
$result = \Safe\preg_match($pattern, $string);
$result = preg_match($pattern, $string);
if (false !== $result && 0 !== $result) {
try {
$date = new Carbon($parts[0]);

View File

@@ -28,6 +28,7 @@ use Illuminate\Mail\Message;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Symfony\Component\Mailer\Exception\TransportException;
/**
@@ -70,7 +71,7 @@ class MailError extends Job implements ShouldQueue
if ($this->attempts() < 3 && '' !== $email) {
try {
\Mail::send(
Mail::send(
['emails.error-html', 'emails.error-text'],
$args,
static function (Message $message) use ($email): void {

View File

@@ -41,6 +41,7 @@ class AppServiceProvider extends ServiceProvider
public function boot(): void
{
Schema::defaultStringLength(191);
// Passport::$clientUuids = false;
Response::macro('api', function (array $value) {
$headers = [
'Cache-Control' => 'no-store',
@@ -58,7 +59,7 @@ class AppServiceProvider extends ServiceProvider
// blade extension
Blade::directive('activeXRoutePartial', function (string $route) {
$name = \Route::getCurrentRoute()->getName() ?? '';
$name = Route::getCurrentRoute()->getName() ?? '';
if (str_contains($name, $route)) {
return 'menu-open';
}

View File

@@ -54,7 +54,7 @@ class UserRepository implements UserRepositoryInterface
// save old email as pref
app('preferences')->setForUser($user, 'previous_email_latest', $oldEmail);
app('preferences')->setForUser($user, 'previous_email_'.\Safe\date('Y-m-d-H-i-s'), $oldEmail);
app('preferences')->setForUser($user, 'previous_email_'.date('Y-m-d-H-i-s'), $oldEmail);
// set undo and confirm token:
app('preferences')->setForUser($user, 'email_change_undo_token', bin2hex(random_bytes(16)));
@@ -389,7 +389,7 @@ class UserRepository implements UserRepositoryInterface
// save old email as pref
app('preferences')->setForUser($user, 'admin_previous_email_latest', $oldEmail);
app('preferences')->setForUser($user, 'admin_previous_email_'.\Safe\date('Y-m-d-H-i-s'), $oldEmail);
app('preferences')->setForUser($user, 'admin_previous_email_'.date('Y-m-d-H-i-s'), $oldEmail);
$user->email = $newEmail;
$user->save();

View File

@@ -39,6 +39,7 @@ use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Services\Internal\Destroy\TransactionGroupDestroyService;
use Illuminate\Support\Facades\Validator;
/**
* Trait AccountServiceTrait
@@ -54,7 +55,7 @@ trait AccountServiceTrait
}
$data = ['iban' => $iban];
$rules = ['iban' => 'required|iban'];
$validator = \Validator::make($data, $rules);
$validator = Validator::make($data, $rules);
if ($validator->fails()) {
app('log')->info(sprintf('Detected invalid IBAN ("%s"). Return NULL instead.', $iban));

View File

@@ -27,6 +27,7 @@ namespace FireflyIII\Services\Internal\Update;
use Carbon\Carbon;
use Carbon\Exceptions\InvalidDateException;
use Carbon\Exceptions\InvalidFormatException;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Events\TriggeredAuditLog;
use FireflyIII\Exceptions\FireflyException;
@@ -723,14 +724,17 @@ class JournalUpdateService
// the correct fields to update in the destination transaction are NOT the foreign amount and currency
// but rather the normal amount and currency. This is new behavior.
$isTransfer = TransactionTypeEnum::TRANSFER->value === $this->transactionJournal->transactionType->type;
if ($isTransfer) {
// also check if it is not between an asset account and a liability, because then the same rule applies.
$isBetween = $this->isBetweenAssetAndLiability();
if ($isTransfer || $isBetween) {
Log::debug('Switch amounts, store in amount and not foreign_amount');
$dest->transaction_currency_id = $foreignCurrency->id;
$dest->amount = app('steam')->positive($foreignAmount);
$dest->foreign_amount = app('steam')->positive($source->amount);
$dest->foreign_currency_id = $source->transaction_currency_id;
}
if (!$isTransfer) {
if (!$isTransfer && !$isBetween) {
$dest->foreign_currency_id = $foreignCurrency->id;
$dest->foreign_amount = app('steam')->positive($foreignAmount);
}
@@ -768,4 +772,48 @@ class JournalUpdateService
$this->sourceTransaction->refresh();
$this->destinationTransaction->refresh();
}
private function isBetweenAssetAndLiability(): bool
{
/** @var Transaction $sourceTransaction */
$sourceTransaction = $this->transactionJournal->transactions()->where('amount', '<', 0)->first();
/** @var Transaction $destinationTransaction */
$destinationTransaction = $this->transactionJournal->transactions()->where('amount', '>', 0)->first();
if (null === $sourceTransaction || null === $destinationTransaction) {
Log::warning('Either transaction is false, stop.');
return false;
}
if (null === $sourceTransaction->foreign_amount || null === $destinationTransaction->foreign_amount) {
Log::warning('Either foreign amount is false, stop.');
return false;
}
$source = $sourceTransaction->account;
$destination = $destinationTransaction->account;
if (null === $source || null === $destination) {
Log::warning('Either is false, stop.');
return false;
}
$sourceTypes = [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value];
// source is liability, destination is asset
if (in_array($source->accountType->type, $sourceTypes, true) && AccountTypeEnum::ASSET->value === $destination->accountType->type) {
Log::debug('Source is a liability account, destination is an asset account, return TRUE.');
return true;
}
// source is asset, destination is liability
if (in_array($destination->accountType->type, $sourceTypes, true) && AccountTypeEnum::ASSET->value === $source->accountType->type) {
Log::debug('Destination is a liability account, source is an asset account, return TRUE.');
return true;
}
return false;
}
}

View File

@@ -67,7 +67,7 @@ class RemoteUserGuard implements Guard
if (function_exists('apache_request_headers')) {
Log::debug('Use apache_request_headers to find user ID.');
$userID = request()->server($header) ?? \Safe\apache_request_headers()[$header] ?? null;
$userID = request()->server($header) ?? apache_request_headers()[$header] ?? null;
}
if (null === $userID || '' === $userID) {
@@ -85,7 +85,7 @@ class RemoteUserGuard implements Guard
$header = config('auth.guard_email');
if (null !== $header) {
$emailAddress = (string) (request()->server($header) ?? \Safe\apache_request_headers()[$header] ?? null);
$emailAddress = (string) (request()->server($header) ?? apache_request_headers()[$header] ?? null);
$preference = app('preferences')->getForUser($retrievedUser, 'remote_guard_alt_email');
if ('' !== $emailAddress && null === $preference && $emailAddress !== $userID) {

View File

@@ -63,7 +63,7 @@ class UpdateCheckCronjob extends AbstractCronjob
$this->jobFired = false;
$this->jobErrored = false;
$this->jobSucceeded = true;
$this->message = sprintf('Checked for updates less than a week ago (on %s).', \Safe\date('Y-m-d H:i:s', $lastCheckTime->data));
$this->message = sprintf('Checked for updates less than a week ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data));
return;
}

View File

@@ -23,7 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Support;
use Eloquent;
use Illuminate\Database\Eloquent\Model;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Support\Form\FormSupport;
use Illuminate\Support\Collection;
@@ -205,7 +205,7 @@ class ExpandedForm
$selectList[0] = '(none)';
$fields = ['title', 'name', 'description'];
/** @var \Eloquent $entry */
/** @var Model $entry */
foreach ($set as $entry) {
// All Eloquent models have an ID
$entryId = $entry->id;

View File

@@ -28,6 +28,7 @@ use FireflyIII\Models\Configuration;
use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Contracts\Encryption\EncryptException;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
/**
@@ -38,8 +39,8 @@ class FireflyConfig
public function delete(string $name): void
{
$fullName = 'ff-config-'.$name;
if (\Cache::has($fullName)) {
\Cache::forget($fullName);
if (Cache::has($fullName)) {
Cache::forget($fullName);
}
Configuration::where('name', $name)->forceDelete();
}
@@ -80,8 +81,8 @@ class FireflyConfig
public function get(string $name, mixed $default = null): ?Configuration
{
$fullName = 'ff-config-'.$name;
if (\Cache::has($fullName)) {
return \Cache::get($fullName);
if (Cache::has($fullName)) {
return Cache::get($fullName);
}
try {
@@ -92,7 +93,7 @@ class FireflyConfig
}
if (null !== $config) {
\Cache::forever($fullName, $config);
Cache::forever($fullName, $config);
return $config;
}
@@ -122,13 +123,13 @@ class FireflyConfig
$item->name = $name;
$item->data = $value;
$item->save();
\Cache::forget('ff-config-'.$name);
Cache::forget('ff3-config-'.$name);
return $item;
}
$config->data = $value;
$config->save();
\Cache::forget('ff-config-'.$name);
Cache::forget('ff3-config-'.$name);
return $config;
}

View File

@@ -33,7 +33,7 @@ use FireflyIII\User;
use Illuminate\Contracts\Validation\Validator as ValidatorContract;
use Illuminate\Routing\Route;
use Illuminate\Support\Facades\Validator;
use Route as RouteFacade;
use Illuminate\Support\Facades\Route as RouteFacade;
/**
* Trait RequestInformation

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Support\System;
use FireflyIII\Exceptions\FireflyException;
use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Crypt;
use Laravel\Passport\Console\KeysCommand;
use Psr\Container\ContainerExceptionInterface;
@@ -88,8 +89,8 @@ class OAuthKeys
public static function generateKeys(): void
{
\Artisan::registerCommand(new KeysCommand());
\Artisan::call('firefly-iii:laravel-passport-keys');
Artisan::registerCommand(new KeysCommand());
Artisan::call('firefly-iii:laravel-passport-keys');
}
public static function storeKeysInDB(): void

View File

@@ -33,7 +33,7 @@ use FireflyIII\Support\Facades\Steam;
use FireflyIII\Support\Search\OperatorQuerySearch;
use Illuminate\Support\Facades\Log;
use League\CommonMark\GithubFlavoredMarkdownConverter;
use Route;
use Illuminate\Support\Facades\Route;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
@@ -211,7 +211,7 @@ class General extends AbstractExtension
{
return new TwigFunction(
'phpdate',
static fn (string $str): string => \Safe\date($str)
static fn (string $str): string => date($str)
);
}
@@ -247,7 +247,7 @@ class General extends AbstractExtension
static function (): string {
$args = func_get_args();
$route = $args[0]; // name of the route.
$name = \Route::getCurrentRoute()->getName() ?? '';
$name = Route::getCurrentRoute()->getName() ?? '';
if (str_contains($name, $route)) {
return 'active';
}
@@ -271,7 +271,7 @@ class General extends AbstractExtension
if ($objectType === $activeObjectType
&& false !== stripos(
(string) \Route::getCurrentRoute()->getName(),
(string) Route::getCurrentRoute()->getName(),
(string) $route
)) {
return 'active';
@@ -294,7 +294,7 @@ class General extends AbstractExtension
static function (): string {
$args = func_get_args();
$route = $args[0]; // name of the route.
$name = \Route::getCurrentRoute()->getName() ?? '';
$name = Route::getCurrentRoute()->getName() ?? '';
if (str_contains($name, $route)) {
return 'menu-open';
}

View File

@@ -116,6 +116,18 @@ class SetDestinationAccount implements ActionInterface
if (TransactionTypeEnum::WITHDRAWAL->value === $type) {
$newAccount = $this->findWithdrawalDestinationAccount($accountName);
}
if (null === $newAccount) {
app('log')->error(
sprintf(
'No destination account found for name "%s".',
$accountName
)
);
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.no_destination', ['name' => $accountName])));
return false;
}
app('log')->debug(sprintf('New destination account is #%d ("%s").', $newAccount->id, $newAccount->name));

View File

@@ -61,6 +61,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Str;
use Laravel\Passport\HasApiTokens;
use NotificationChannels\Pushover\PushoverReceiver;
@@ -464,7 +465,7 @@ class User extends Authenticatable
*/
public function sendPasswordResetNotification($token): void
{
$ipAddress = \Request::ip();
$ipAddress = Request::ip();
event(new RequestedNewPassword($this, $token, $ipAddress));
}

View File

@@ -44,6 +44,7 @@ use Illuminate\Validation\Validator;
use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException;
use PragmaRX\Google2FA\Exceptions\InvalidCharactersException;
use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException;
use PragmaRX\Google2FALaravel\Facade;
/**
* Class FireflyValidator.
@@ -79,7 +80,7 @@ class FireflyValidator extends Validator
}
$secret = (string) $secret;
return (bool) \Google2FA::verifyKey($secret, $value);
return (bool) Facade::verifyKey($secret, $value);
}
/**
@@ -131,7 +132,7 @@ class FireflyValidator extends Validator
}
$secret = (string) $user->mfa_secret;
return (bool) \Google2FA::verifyKey($secret, $value);
return (bool) Facade::verifyKey($secret, $value);
}
/**

View File

@@ -3,6 +3,29 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 6.2.14 - 2025-05-26
### Fixed
- [Issue 10356](https://github.com/firefly-iii/firefly-iii/issues/10356) (Call to undefined method createPersonalAccessClient()) reported by @JC5
- [Issue 10357](https://github.com/firefly-iii/firefly-iii/issues/10357) (Target AuthorizationViewResponse is not instantiable) reported by @JC5
## 6.2.13 - 2025-05-25
### Fixed
- [Issue 10114](https://github.com/firefly-iii/firefly-iii/issues/10114) (Budget for foreign currency not getting updated when a transaction refers to it) reported by @srikakulamts
- [Issue 10180](https://github.com/firefly-iii/firefly-iii/issues/10180) (missing SPENT info) reported by @frank-bg
- [Issue 10197](https://github.com/firefly-iii/firefly-iii/issues/10197) (Add rule number) reported by @gogoizzy
- [PR 10203](https://github.com/firefly-iii/firefly-iii/pull/10203) (Fix Ukrainian language names) reported by @den-is
- [Issue 10265](https://github.com/firefly-iii/firefly-iii/issues/10265) (Liabilities, foreign currencies have some issues (payment/exchange with native currency)) reported by @jgmm81
- [Issue 10290](https://github.com/firefly-iii/firefly-iii/issues/10290) (edit multiple transactions individually ignores reconciled state) reported by @goebeler
- [Issue 10302](https://github.com/firefly-iii/firefly-iii/issues/10302) (Attempt to read property "id" on null Error) reported by @XBadPlayerX
- [Issue 10305](https://github.com/firefly-iii/firefly-iii/issues/10305) (The info icon used to display transactions is not clickable in the default financial reports "budgets by accounts"-section's sum column) reported by @goebeler
- [Issue 10308](https://github.com/firefly-iii/firefly-iii/issues/10308) (Liabilities, with some details (payment/exchange with native currency)) reported by @jgmm81
- [Issue 10320](https://github.com/firefly-iii/firefly-iii/issues/10320) (Button to update transaction keeps being disabled after correcting form errors) reported by @Astro1247
- [Issue 10336](https://github.com/firefly-iii/firefly-iii/issues/10336) (New install recovering backup from 5.7.18 fails to run. ($param) must be of type int, string given in orrectsUnevenAmount.php) reported by @perezalvarezhi
## 6.2.12 - 2025-04-21
### Fixed

View File

@@ -89,7 +89,8 @@
"jc5/recovery": "^2",
"laravel-notification-channels/pushover": "^4.0",
"laravel/framework": "^12",
"laravel/passport": "^12",
"laravel/passport": "^12.0",
"laravel/sanctum": "^4.1",
"laravel/slack-notification-channel": "^3.3",
"laravel/ui": "^4.2",
"league/commonmark": "^2",
@@ -107,7 +108,8 @@
"spatie/period": "^2.4",
"symfony/expression-language": "^7.0",
"symfony/http-client": "^7.1",
"symfony/mailgun-mailer": "^7.1"
"symfony/mailgun-mailer": "^7.1",
"thecodingmachine/safe": "^3.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.9",

468
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "be90fbe2c861ffb51547daafa97e4473",
"content-hash": "b630645d62adf0b4c2a9a16ccfc7a3cc",
"packages": [
{
"name": "bacon/bacon-qr-code",
@@ -1879,16 +1879,16 @@
},
{
"name": "laravel/framework",
"version": "v12.13.0",
"version": "v12.15.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "52b588bcd8efc6d01bc1493d2d67848f8065f269"
"reference": "2ef7fb183f18e547af4eb9f5a55b2ac1011f0b77"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/52b588bcd8efc6d01bc1493d2d67848f8065f269",
"reference": "52b588bcd8efc6d01bc1493d2d67848f8065f269",
"url": "https://api.github.com/repos/laravel/framework/zipball/2ef7fb183f18e547af4eb9f5a55b2ac1011f0b77",
"reference": "2ef7fb183f18e547af4eb9f5a55b2ac1011f0b77",
"shasum": ""
},
"require": {
@@ -2090,7 +2090,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2025-05-07T17:29:01+00:00"
"time": "2025-05-20T15:10:44+00:00"
},
{
"name": "laravel/passport",
@@ -2227,6 +2227,70 @@
},
"time": "2025-02-11T13:34:40+00:00"
},
{
"name": "laravel/sanctum",
"version": "v4.1.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/sanctum.git",
"reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sanctum/zipball/a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
"reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/console": "^11.0|^12.0",
"illuminate/contracts": "^11.0|^12.0",
"illuminate/database": "^11.0|^12.0",
"illuminate/support": "^11.0|^12.0",
"php": "^8.2",
"symfony/console": "^7.0"
},
"require-dev": {
"mockery/mockery": "^1.6",
"orchestra/testbench": "^9.0|^10.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^11.3"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Laravel\\Sanctum\\SanctumServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Sanctum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.",
"keywords": [
"auth",
"laravel",
"sanctum"
],
"support": {
"issues": "https://github.com/laravel/sanctum/issues",
"source": "https://github.com/laravel/sanctum"
},
"time": "2025-04-23T13:03:38+00:00"
},
{
"name": "laravel/serializable-closure",
"version": "v2.0.4",
@@ -5039,16 +5103,16 @@
},
{
"name": "predis/predis",
"version": "v3.0.0",
"version": "v3.0.1",
"source": {
"type": "git",
"url": "https://github.com/predis/predis.git",
"reference": "7d86f7afb37940bfc7aaa2909147616881377667"
"reference": "34fb0a7da0330df1bab4280fcac4afdeeccc3edf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/predis/predis/zipball/7d86f7afb37940bfc7aaa2909147616881377667",
"reference": "7d86f7afb37940bfc7aaa2909147616881377667",
"url": "https://api.github.com/repos/predis/predis/zipball/34fb0a7da0330df1bab4280fcac4afdeeccc3edf",
"reference": "34fb0a7da0330df1bab4280fcac4afdeeccc3edf",
"shasum": ""
},
"require": {
@@ -5090,7 +5154,7 @@
],
"support": {
"issues": "https://github.com/predis/predis/issues",
"source": "https://github.com/predis/predis/tree/v3.0.0"
"source": "https://github.com/predis/predis/tree/v3.0.1"
},
"funding": [
{
@@ -5098,7 +5162,7 @@
"type": "github"
}
],
"time": "2025-05-02T23:18:59+00:00"
"time": "2025-05-16T18:30:32+00:00"
},
{
"name": "psr/cache",
@@ -9292,6 +9356,145 @@
],
"time": "2025-05-02T08:36:00+00:00"
},
{
"name": "thecodingmachine/safe",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/thecodingmachine/safe.git",
"reference": "2cdd579eeaa2e78e51c7509b50cc9fb89a956236"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thecodingmachine/safe/zipball/2cdd579eeaa2e78e51c7509b50cc9fb89a956236",
"reference": "2cdd579eeaa2e78e51c7509b50cc9fb89a956236",
"shasum": ""
},
"require": {
"php": "^8.1"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpstan/phpstan": "^2",
"phpunit/phpunit": "^10",
"squizlabs/php_codesniffer": "^3.2"
},
"type": "library",
"autoload": {
"files": [
"lib/special_cases.php",
"generated/apache.php",
"generated/apcu.php",
"generated/array.php",
"generated/bzip2.php",
"generated/calendar.php",
"generated/classobj.php",
"generated/com.php",
"generated/cubrid.php",
"generated/curl.php",
"generated/datetime.php",
"generated/dir.php",
"generated/eio.php",
"generated/errorfunc.php",
"generated/exec.php",
"generated/fileinfo.php",
"generated/filesystem.php",
"generated/filter.php",
"generated/fpm.php",
"generated/ftp.php",
"generated/funchand.php",
"generated/gettext.php",
"generated/gmp.php",
"generated/gnupg.php",
"generated/hash.php",
"generated/ibase.php",
"generated/ibmDb2.php",
"generated/iconv.php",
"generated/image.php",
"generated/imap.php",
"generated/info.php",
"generated/inotify.php",
"generated/json.php",
"generated/ldap.php",
"generated/libxml.php",
"generated/lzf.php",
"generated/mailparse.php",
"generated/mbstring.php",
"generated/misc.php",
"generated/mysql.php",
"generated/mysqli.php",
"generated/network.php",
"generated/oci8.php",
"generated/opcache.php",
"generated/openssl.php",
"generated/outcontrol.php",
"generated/pcntl.php",
"generated/pcre.php",
"generated/pgsql.php",
"generated/posix.php",
"generated/ps.php",
"generated/pspell.php",
"generated/readline.php",
"generated/rnp.php",
"generated/rpminfo.php",
"generated/rrd.php",
"generated/sem.php",
"generated/session.php",
"generated/shmop.php",
"generated/sockets.php",
"generated/sodium.php",
"generated/solr.php",
"generated/spl.php",
"generated/sqlsrv.php",
"generated/ssdeep.php",
"generated/ssh2.php",
"generated/stream.php",
"generated/strings.php",
"generated/swoole.php",
"generated/uodbc.php",
"generated/uopz.php",
"generated/url.php",
"generated/var.php",
"generated/xdiff.php",
"generated/xml.php",
"generated/xmlrpc.php",
"generated/yaml.php",
"generated/yaz.php",
"generated/zip.php",
"generated/zlib.php"
],
"classmap": [
"lib/DateTime.php",
"lib/DateTimeImmutable.php",
"lib/Exceptions/",
"generated/Exceptions/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHP core functions that throw exceptions instead of returning FALSE on error",
"support": {
"issues": "https://github.com/thecodingmachine/safe/issues",
"source": "https://github.com/thecodingmachine/safe/tree/v3.3.0"
},
"funding": [
{
"url": "https://github.com/OskarStark",
"type": "github"
},
{
"url": "https://github.com/shish",
"type": "github"
},
{
"url": "https://github.com/staabm",
"type": "github"
}
],
"time": "2025-05-14T06:15:44+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
"version": "v2.3.0",
@@ -10833,16 +11036,16 @@
},
{
"name": "phpstan/phpstan",
"version": "2.1.14",
"version": "2.1.17",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "8f2e03099cac24ff3b379864d171c5acbfc6b9a2"
"reference": "89b5ef665716fa2a52ecd2633f21007a6a349053"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/8f2e03099cac24ff3b379864d171c5acbfc6b9a2",
"reference": "8f2e03099cac24ff3b379864d171c5acbfc6b9a2",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/89b5ef665716fa2a52ecd2633f21007a6a349053",
"reference": "89b5ef665716fa2a52ecd2633f21007a6a349053",
"shasum": ""
},
"require": {
@@ -10887,25 +11090,25 @@
"type": "github"
}
],
"time": "2025-05-02T15:32:28+00:00"
"time": "2025-05-21T20:55:28+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",
"version": "2.0.2",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-deprecation-rules.git",
"reference": "9d8e7d4e32711715ad78a1fb6ec368df9af01fdf"
"reference": "468e02c9176891cc901143da118f09dc9505fc2f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/9d8e7d4e32711715ad78a1fb6ec368df9af01fdf",
"reference": "9d8e7d4e32711715ad78a1fb6ec368df9af01fdf",
"url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/468e02c9176891cc901143da118f09dc9505fc2f",
"reference": "468e02c9176891cc901143da118f09dc9505fc2f",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0",
"phpstan/phpstan": "^2.1.13"
"phpstan/phpstan": "^2.1.15"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
@@ -10932,9 +11135,9 @@
"description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.",
"support": {
"issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues",
"source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.2"
"source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.3"
},
"time": "2025-04-26T19:59:57+00:00"
"time": "2025-05-14T10:56:57+00:00"
},
{
"name": "phpstan/phpstan-strict-rules",
@@ -10986,16 +11189,16 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "12.2.1",
"version": "12.3.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "448f2c504d86dbff3949dcd02c95aa85db2c7617"
"reference": "9075a8efc66e11bc55c319062e147bdb06777267"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/448f2c504d86dbff3949dcd02c95aa85db2c7617",
"reference": "448f2c504d86dbff3949dcd02c95aa85db2c7617",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9075a8efc66e11bc55c319062e147bdb06777267",
"reference": "9075a8efc66e11bc55c319062e147bdb06777267",
"shasum": ""
},
"require": {
@@ -11022,7 +11225,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "12.2.x-dev"
"dev-main": "12.3.x-dev"
}
},
"autoload": {
@@ -11051,7 +11254,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.2.1"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.3.0"
},
"funding": [
{
@@ -11071,7 +11274,7 @@
"type": "tidelift"
}
],
"time": "2025-05-04T05:25:05+00:00"
"time": "2025-05-23T15:49:03+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -11320,16 +11523,16 @@
},
{
"name": "phpunit/phpunit",
"version": "12.1.5",
"version": "12.1.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "f93ef2198df8d54b3195bcee381a33be51d8705e"
"reference": "2fdf0056c673c8f0f1eed00030be5f8243c1e6e0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f93ef2198df8d54b3195bcee381a33be51d8705e",
"reference": "f93ef2198df8d54b3195bcee381a33be51d8705e",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2fdf0056c673c8f0f1eed00030be5f8243c1e6e0",
"reference": "2fdf0056c673c8f0f1eed00030be5f8243c1e6e0",
"shasum": ""
},
"require": {
@@ -11351,7 +11554,7 @@
"sebastian/cli-parser": "^4.0.0",
"sebastian/comparator": "^7.0.1",
"sebastian/diff": "^7.0.0",
"sebastian/environment": "^8.0.0",
"sebastian/environment": "^8.0.1",
"sebastian/exporter": "^7.0.0",
"sebastian/global-state": "^8.0.0",
"sebastian/object-enumerator": "^7.0.0",
@@ -11397,7 +11600,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.1.5"
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.1.6"
},
"funding": [
{
@@ -11421,20 +11624,20 @@
"type": "tidelift"
}
],
"time": "2025-05-11T06:44:52+00:00"
"time": "2025-05-21T12:36:31+00:00"
},
{
"name": "rector/rector",
"version": "2.0.15",
"version": "2.0.16",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "abbbf32474a67e242d26bffc098a712a05b3d32a"
"reference": "f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/abbbf32474a67e242d26bffc098a712a05b3d32a",
"reference": "abbbf32474a67e242d26bffc098a712a05b3d32a",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2",
"reference": "f1366d1f8c7490541c8f7af6e5c7cef7cca1b5a2",
"shasum": ""
},
"require": {
@@ -11472,7 +11675,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/2.0.15"
"source": "https://github.com/rectorphp/rector/tree/2.0.16"
},
"funding": [
{
@@ -11480,7 +11683,7 @@
"type": "github"
}
],
"time": "2025-05-05T10:00:41+00:00"
"time": "2025-05-12T16:37:16+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -11746,16 +11949,16 @@
},
{
"name": "sebastian/environment",
"version": "8.0.0",
"version": "8.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "8afe311eca49171bf95405cc0078be9a3821f9f2"
"reference": "d364b9e5d0d3b18a2573351a1786fbf96b7e0792"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8afe311eca49171bf95405cc0078be9a3821f9f2",
"reference": "8afe311eca49171bf95405cc0078be9a3821f9f2",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d364b9e5d0d3b18a2573351a1786fbf96b7e0792",
"reference": "d364b9e5d0d3b18a2573351a1786fbf96b7e0792",
"shasum": ""
},
"require": {
@@ -11798,15 +12001,27 @@
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
"security": "https://github.com/sebastianbergmann/environment/security/policy",
"source": "https://github.com/sebastianbergmann/environment/tree/8.0.0"
"source": "https://github.com/sebastianbergmann/environment/tree/8.0.2"
},
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
},
{
"url": "https://liberapay.com/sebastianbergmann",
"type": "liberapay"
},
{
"url": "https://thanks.dev/u/gh/sebastianbergmann",
"type": "thanks_dev"
},
{
"url": "https://tidelift.com/funding/github/packagist/sebastian/environment",
"type": "tidelift"
}
],
"time": "2025-02-07T04:56:08+00:00"
"time": "2025-05-21T15:05:44+00:00"
},
{
"name": "sebastian/exporter",
@@ -12349,22 +12564,22 @@
},
{
"name": "thecodingmachine/phpstan-safe-rule",
"version": "v1.4.0",
"version": "v1.4.1",
"source": {
"type": "git",
"url": "https://github.com/thecodingmachine/phpstan-safe-rule.git",
"reference": "33dcbc3228c55ea4c364ecf74a3661cf7b7f168d"
"reference": "5f9795eae8891dffa475965463a4281633651768"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/33dcbc3228c55ea4c364ecf74a3661cf7b7f168d",
"reference": "33dcbc3228c55ea4c364ecf74a3661cf7b7f168d",
"url": "https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/5f9795eae8891dffa475965463a4281633651768",
"reference": "5f9795eae8891dffa475965463a4281633651768",
"shasum": ""
},
"require": {
"nikic/php-parser": "^5",
"php": "^8.1",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan": "^2.1.11",
"thecodingmachine/safe": "^1.2 || ^2.0 || ^3.0"
},
"require-dev": {
@@ -12401,148 +12616,9 @@
"description": "A PHPStan rule to detect safety issues. Must be used in conjunction with thecodingmachine/safe",
"support": {
"issues": "https://github.com/thecodingmachine/phpstan-safe-rule/issues",
"source": "https://github.com/thecodingmachine/phpstan-safe-rule/tree/v1.4.0"
"source": "https://github.com/thecodingmachine/phpstan-safe-rule/tree/v1.4.1"
},
"time": "2025-02-11T12:41:29+00:00"
},
{
"name": "thecodingmachine/safe",
"version": "v3.1.1",
"source": {
"type": "git",
"url": "https://github.com/thecodingmachine/safe.git",
"reference": "234f6fe34a0bead8c5ae1cfc0800539442e6f619"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thecodingmachine/safe/zipball/234f6fe34a0bead8c5ae1cfc0800539442e6f619",
"reference": "234f6fe34a0bead8c5ae1cfc0800539442e6f619",
"shasum": ""
},
"require": {
"php": "^8.1"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpstan/phpstan": "^2",
"phpunit/phpunit": "^10",
"squizlabs/php_codesniffer": "^3.2"
},
"type": "library",
"autoload": {
"files": [
"lib/special_cases.php",
"generated/apache.php",
"generated/apcu.php",
"generated/array.php",
"generated/bzip2.php",
"generated/calendar.php",
"generated/classobj.php",
"generated/com.php",
"generated/cubrid.php",
"generated/curl.php",
"generated/datetime.php",
"generated/dir.php",
"generated/eio.php",
"generated/errorfunc.php",
"generated/exec.php",
"generated/fileinfo.php",
"generated/filesystem.php",
"generated/filter.php",
"generated/fpm.php",
"generated/ftp.php",
"generated/funchand.php",
"generated/gettext.php",
"generated/gmp.php",
"generated/gnupg.php",
"generated/hash.php",
"generated/ibase.php",
"generated/ibmDb2.php",
"generated/iconv.php",
"generated/image.php",
"generated/imap.php",
"generated/info.php",
"generated/inotify.php",
"generated/json.php",
"generated/ldap.php",
"generated/libxml.php",
"generated/lzf.php",
"generated/mailparse.php",
"generated/mbstring.php",
"generated/misc.php",
"generated/mysql.php",
"generated/mysqli.php",
"generated/network.php",
"generated/oci8.php",
"generated/opcache.php",
"generated/openssl.php",
"generated/outcontrol.php",
"generated/pcntl.php",
"generated/pcre.php",
"generated/pgsql.php",
"generated/posix.php",
"generated/ps.php",
"generated/pspell.php",
"generated/readline.php",
"generated/rnp.php",
"generated/rpminfo.php",
"generated/rrd.php",
"generated/sem.php",
"generated/session.php",
"generated/shmop.php",
"generated/sockets.php",
"generated/sodium.php",
"generated/solr.php",
"generated/spl.php",
"generated/sqlsrv.php",
"generated/ssdeep.php",
"generated/ssh2.php",
"generated/stream.php",
"generated/strings.php",
"generated/swoole.php",
"generated/uodbc.php",
"generated/uopz.php",
"generated/url.php",
"generated/var.php",
"generated/xdiff.php",
"generated/xml.php",
"generated/xmlrpc.php",
"generated/yaml.php",
"generated/yaz.php",
"generated/zip.php",
"generated/zlib.php"
],
"classmap": [
"lib/DateTime.php",
"lib/DateTimeImmutable.php",
"lib/Exceptions/",
"generated/Exceptions/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHP core functions that throw exceptions instead of returning FALSE on error",
"support": {
"issues": "https://github.com/thecodingmachine/safe/issues",
"source": "https://github.com/thecodingmachine/safe/tree/v3.1.1"
},
"funding": [
{
"url": "https://github.com/OskarStark",
"type": "github"
},
{
"url": "https://github.com/shish",
"type": "github"
},
{
"url": "https://github.com/staabm",
"type": "github"
}
],
"time": "2025-04-28T07:56:17+00:00"
"time": "2025-04-09T20:30:35+00:00"
},
{
"name": "theseer/tokenizer",

View File

@@ -42,15 +42,10 @@ use FireflyIII\Providers\SearchServiceProvider;
use FireflyIII\Providers\SessionServiceProvider;
use FireflyIII\Providers\TagServiceProvider;
use FireflyIII\Support\Facades\AccountForm;
use FireflyIII\Support\Facades\Amount;
use FireflyIII\Support\Facades\CurrencyForm;
use FireflyIII\Support\Facades\ExpandedForm;
use FireflyIII\Support\Facades\FireflyConfig;
use FireflyIII\Support\Facades\Navigation;
use FireflyIII\Support\Facades\PiggyBankForm;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Facades\RuleForm;
use FireflyIII\Support\Facades\Steam;
use Illuminate\Auth\AuthServiceProvider;
use Illuminate\Auth\Passwords\PasswordResetServiceProvider;
use Illuminate\Broadcasting\BroadcastServiceProvider;
@@ -58,7 +53,6 @@ use Illuminate\Bus\BusServiceProvider;
use Illuminate\Cache\CacheServiceProvider;
use Illuminate\Cookie\CookieServiceProvider;
use Illuminate\Database\DatabaseServiceProvider;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Encryption\EncryptionServiceProvider;
use Illuminate\Filesystem\FilesystemServiceProvider;
use Illuminate\Foundation\Providers\ConsoleSupportServiceProvider;
@@ -70,47 +64,15 @@ use Illuminate\Pagination\PaginationServiceProvider;
use Illuminate\Pipeline\PipelineServiceProvider;
use Illuminate\Queue\QueueServiceProvider;
use Illuminate\Redis\RedisServiceProvider;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\Facades\Bus;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Cookie;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Str;
use Illuminate\Translation\TranslationServiceProvider;
use Illuminate\Validation\ValidationServiceProvider;
use Illuminate\View\ViewServiceProvider;
use PragmaRX\Google2FALaravel\Facade;
use Spatie\Html\Facades\Html;
use TwigBridge\Facade\Twig;
use TwigBridge\ServiceProvider;
return [
@@ -179,56 +141,17 @@ return [
RecurringServiceProvider::class,
],
'aliases' => [
'App' => App::class,
'Artisan' => Artisan::class,
'Auth' => Auth::class,
'Blade' => Blade::class,
'Broadcast' => Broadcast::class,
'Bus' => Bus::class,
'Cache' => Cache::class,
'Config' => Config::class,
'Cookie' => Cookie::class,
'Crypt' => Crypt::class,
'DB' => DB::class,
'Eloquent' => Model::class,
'Event' => Event::class,
'File' => File::class,
'Gate' => Gate::class,
'Hash' => Hash::class,
'Lang' => Lang::class,
'Log' => Log::class,
'Mail' => Mail::class,
'Notification' => Notification::class,
'Password' => Password::class,
'Queue' => Queue::class,
'Redirect' => Redirect::class,
'Redis' => Redis::class,
'Request' => Request::class,
'Response' => Response::class,
'Route' => Route::class,
'Schema' => Schema::class,
'Config' => Config::class,
'Session' => Session::class,
'Storage' => Storage::class,
'URL' => URL::class,
'Validator' => Validator::class,
'View' => View::class,
'Html' => Html::class,
'Preferences' => Preferences::class,
'FireflyConfig' => FireflyConfig::class,
'Navigation' => Navigation::class,
'Amount' => Amount::class,
'Steam' => Steam::class,
'ExpandedForm' => ExpandedForm::class,
'CurrencyForm' => CurrencyForm::class,
'AccountForm' => AccountForm::class,
'CurrencyForm' => CurrencyForm::class,
'ExpandedForm' => ExpandedForm::class,
'PiggyBankForm' => PiggyBankForm::class,
'RuleForm' => RuleForm::class,
'Google2FA' => Facade::class,
'Twig' => Twig::class,
'Arr' => Arr::class,
'Http' => Http::class,
'Str' => Str::class,
],
'asset_url' => env('ASSET_URL', null),

View File

@@ -78,7 +78,7 @@ return [
'running_balance_column' => env('USE_RUNNING_BALANCE', false),
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2025-05-11',
'version' => 'develop/2025-05-25',
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 25,

View File

@@ -32,7 +32,7 @@ return [
'table' => 'sessions',
'store' => null,
'lottery' => [2, 100],
'cookie' => 'firefly_session',
'cookie' => env('COOKIE_NAME', 'firefly_iii_session'),
'path' => env('COOKIE_PATH', '/'),
'domain' => env('COOKIE_DOMAIN', null),
'secure' => env('COOKIE_SECURE', null),

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class CreateSupportTables.

Some files were not shown because too many files have changed in this diff Show More