From 13a1e45fc5007bcd2d945bf130735e2d283e3196 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 03:56:32 +0000 Subject: [PATCH 01/24] Bump nunomaduro/collision from 7.0.3 to 7.0.5 Bumps [nunomaduro/collision](https://github.com/nunomaduro/collision) from 7.0.3 to 7.0.5. - [Release notes](https://github.com/nunomaduro/collision/releases) - [Changelog](https://github.com/nunomaduro/collision/blob/v7.x/CHANGELOG.md) - [Commits](https://github.com/nunomaduro/collision/compare/v7.0.3...v7.0.5) --- updated-dependencies: - dependency-name: nunomaduro/collision dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index e854171b3c..86f4b64dfd 100644 --- a/composer.lock +++ b/composer.lock @@ -3829,16 +3829,16 @@ }, { "name": "nunomaduro/collision", - "version": "v7.0.3", + "version": "v7.0.5", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "fbf3c8a8ee08068bee7d81ee0cee5ddf032aaa84" + "reference": "5c654ee5fa187cf2f4cb226d773582ec6d402a55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/fbf3c8a8ee08068bee7d81ee0cee5ddf032aaa84", - "reference": "fbf3c8a8ee08068bee7d81ee0cee5ddf032aaa84", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/5c654ee5fa187cf2f4cb226d773582ec6d402a55", + "reference": "5c654ee5fa187cf2f4cb226d773582ec6d402a55", "shasum": "" }, "require": { @@ -3848,15 +3848,16 @@ "symfony/console": "^6.2.5" }, "require-dev": { - "laravel/framework": "^10.0.0", + "laravel/framework": "^10.0.3", "laravel/pint": "^1.5.0", "laravel/sail": "^1.20.2", "laravel/sanctum": "^3.2.1", "laravel/tinker": "^2.8.0", - "nunomaduro/larastan": "^2.4.0", - "orchestra/testbench-core": "^8.0.0", + "nunomaduro/larastan": "^2.4.1", + "orchestra/testbench-core": "^8.0.1", "pestphp/pest": "^2.0.0", - "phpunit/phpunit": "^10.0.7", + "phpunit/phpunit": "^10.0.9", + "sebastian/environment": "^6.0.0", "spatie/laravel-ignition": "^2.0.0" }, "type": "library", @@ -3916,7 +3917,7 @@ "type": "patreon" } ], - "time": "2023-02-16T14:34:30+00:00" + "time": "2023-02-19T16:25:13+00:00" }, { "name": "nunomaduro/termwind", From eb04b11c300e38dd4c438ca3c87c0df121675f7b Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 20 Feb 2023 12:46:21 +0100 Subject: [PATCH 02/24] Update session.php Signed-off-by: James Cole --- config/session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/session.php b/config/session.php index 4de1115cfd..5c3f533835 100644 --- a/config/session.php +++ b/config/session.php @@ -24,7 +24,7 @@ declare(strict_types=1); return [ 'driver' => env('SESSION_DRIVER', 'file'), 'lifetime' => 120, - 'expire_on_close' => false, + 'expire_on_close' => true, 'encrypt' => true, 'files' => storage_path('framework/sessions'), 'connection' => null, From 26ab65c5aad7045e312b2aba52229a85f96d552e Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 22 Feb 2023 17:11:59 +0100 Subject: [PATCH 03/24] Various code cleanup, see if Qodana picks them up --- .../Controllers/System/InstallController.php | 15 ++----------- app/Repositories/Tag/TagRepository.php | 21 +++++++------------ app/Support/Http/Controllers/CreateStuff.php | 17 +-------------- public/v1/css/firefly.css | 2 +- .../transactions/CustomTransactionFields.vue | 2 +- 5 files changed, 13 insertions(+), 44 deletions(-) diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index bb85b88a08..d8153ba008 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -36,7 +36,6 @@ use Illuminate\Http\Request; use Illuminate\View\View; use Laravel\Passport\Passport; use Log; -use phpseclib\Crypt\RSA as LegacyRSA; use phpseclib3\Crypt\RSA; /** @@ -228,18 +227,8 @@ class InstallController extends Controller // switch on PHP version. $keys = []; // switch on class existence. - Log::info(sprintf('PHP version is %s', phpversion())); - if (class_exists(LegacyRSA::class)) { - // PHP 7 - Log::info('Will run PHP7 code.'); - $keys = (new LegacyRSA())->createKey(4096); - } - - if (!class_exists(LegacyRSA::class)) { - // PHP 8 - Log::info('Will run PHP8 code.'); - $keys = RSA::createKey(4096); - } + Log::info('Will run PHP8 code.'); + $keys = RSA::createKey(4096); [$publicKey, $privateKey] = [ Passport::keyPath('oauth-public.key'), diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index c44bf69cd5..a6763bb3f9 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -136,6 +136,7 @@ class TagRepository implements TagRepositoryInterface */ public function findByTag(string $tag): ?Tag { + /** @var Tag|null */ return $this->user->tags()->where('tag', $tag)->first(); } @@ -146,12 +147,8 @@ class TagRepository implements TagRepositoryInterface */ public function firstUseDate(Tag $tag): ?Carbon { - $journal = $tag->transactionJournals()->orderBy('date', 'ASC')->first(); - if (null !== $journal) { - return $journal->date; - } - - return null; + /** @var Carbon|null */ + return $tag->transactionJournals()->orderBy('date', 'ASC')->first()?->date; } /** @@ -236,12 +233,8 @@ class TagRepository implements TagRepositoryInterface */ public function lastUseDate(Tag $tag): ?Carbon { - $journal = $tag->transactionJournals()->orderBy('date', 'DESC')->first(); - if (null !== $journal) { - return $journal->date; - } - - return null; + /** @var Carbon|null */ + return $tag->transactionJournals()->orderBy('date', 'DESC')->first()?->date; } /** @@ -251,6 +244,7 @@ class TagRepository implements TagRepositoryInterface */ public function newestTag(): ?Tag { + /** @var Tag|null */ return $this->user->tags()->whereNotNull('date')->orderBy('date', 'DESC')->first(); } @@ -259,6 +253,7 @@ class TagRepository implements TagRepositoryInterface */ public function oldestTag(): ?Tag { + /** @var Tag|null */ return $this->user->tags()->whereNotNull('date')->orderBy('date', 'ASC')->first(); } @@ -370,7 +365,6 @@ class TagRepository implements TagRepositoryInterface ]; // add foreign amount to correct type: $amount = app('steam')->positive((string)$journal['foreign_amount']); - $type = $journal['transaction_type_type']; if (TransactionType::WITHDRAWAL === $type) { $amount = bcmul($amount, '-1'); } @@ -458,6 +452,7 @@ class TagRepository implements TagRepositoryInterface */ public function getLocation(Tag $tag): ?Location { + /** @var Location|null */ return $tag->locations()->first(); } } diff --git a/app/Support/Http/Controllers/CreateStuff.php b/app/Support/Http/Controllers/CreateStuff.php index 368b57ea1e..df8cdf4af0 100644 --- a/app/Support/Http/Controllers/CreateStuff.php +++ b/app/Support/Http/Controllers/CreateStuff.php @@ -30,7 +30,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\User; use Laravel\Passport\Passport; use Log; -use phpseclib\Crypt\RSA as LegacyRSA; use phpseclib3\Crypt\RSA; /** @@ -113,21 +112,7 @@ trait CreateStuff return; } - // switch on class existence. - $keys = []; - Log::info(sprintf('PHP version is %s', phpversion())); - if (class_exists(LegacyRSA::class)) { - // PHP 7 - Log::info('Will run PHP7 code.'); - $keys = (new LegacyRSA())->createKey(4096); - } - - if (!class_exists(LegacyRSA::class)) { - // PHP 8 - Log::info('Will run PHP8 code.'); - $keys = RSA::createKey(4096); - } - + $keys = RSA::createKey(4096); Log::alert('NO OAuth keys were found. They have been created.'); diff --git a/public/v1/css/firefly.css b/public/v1/css/firefly.css index 70c5658c13..2c93945e76 100644 --- a/public/v1/css/firefly.css +++ b/public/v1/css/firefly.css @@ -26,7 +26,7 @@ input.ti-new-tag-input { font-size: 14px !important; line-height: 1.42857143; - color:red; /* color: #555;*/ + color: #555; font-family:"Source Sans Pro", "Helvetica Neue",Helvetica,Arial,sans-serif !important; } diff --git a/resources/assets/js/components/transactions/CustomTransactionFields.vue b/resources/assets/js/components/transactions/CustomTransactionFields.vue index 7dbfdc11ed..e55fcf0014 100644 --- a/resources/assets/js/components/transactions/CustomTransactionFields.vue +++ b/resources/assets/js/components/transactions/CustomTransactionFields.vue @@ -20,7 +20,7 @@