mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various code cleanup, see if Qodana picks them up
This commit is contained in:
@@ -36,7 +36,6 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
use Laravel\Passport\Passport;
|
use Laravel\Passport\Passport;
|
||||||
use Log;
|
use Log;
|
||||||
use phpseclib\Crypt\RSA as LegacyRSA;
|
|
||||||
use phpseclib3\Crypt\RSA;
|
use phpseclib3\Crypt\RSA;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -228,18 +227,8 @@ class InstallController extends Controller
|
|||||||
// switch on PHP version.
|
// switch on PHP version.
|
||||||
$keys = [];
|
$keys = [];
|
||||||
// switch on class existence.
|
// switch on class existence.
|
||||||
Log::info(sprintf('PHP version is %s', phpversion()));
|
Log::info('Will run PHP8 code.');
|
||||||
if (class_exists(LegacyRSA::class)) {
|
$keys = RSA::createKey(4096);
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
[$publicKey, $privateKey] = [
|
[$publicKey, $privateKey] = [
|
||||||
Passport::keyPath('oauth-public.key'),
|
Passport::keyPath('oauth-public.key'),
|
||||||
|
@@ -136,6 +136,7 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function findByTag(string $tag): ?Tag
|
public function findByTag(string $tag): ?Tag
|
||||||
{
|
{
|
||||||
|
/** @var Tag|null */
|
||||||
return $this->user->tags()->where('tag', $tag)->first();
|
return $this->user->tags()->where('tag', $tag)->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,12 +147,8 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function firstUseDate(Tag $tag): ?Carbon
|
public function firstUseDate(Tag $tag): ?Carbon
|
||||||
{
|
{
|
||||||
$journal = $tag->transactionJournals()->orderBy('date', 'ASC')->first();
|
/** @var Carbon|null */
|
||||||
if (null !== $journal) {
|
return $tag->transactionJournals()->orderBy('date', 'ASC')->first()?->date;
|
||||||
return $journal->date;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -236,12 +233,8 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function lastUseDate(Tag $tag): ?Carbon
|
public function lastUseDate(Tag $tag): ?Carbon
|
||||||
{
|
{
|
||||||
$journal = $tag->transactionJournals()->orderBy('date', 'DESC')->first();
|
/** @var Carbon|null */
|
||||||
if (null !== $journal) {
|
return $tag->transactionJournals()->orderBy('date', 'DESC')->first()?->date;
|
||||||
return $journal->date;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -251,6 +244,7 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function newestTag(): ?Tag
|
public function newestTag(): ?Tag
|
||||||
{
|
{
|
||||||
|
/** @var Tag|null */
|
||||||
return $this->user->tags()->whereNotNull('date')->orderBy('date', 'DESC')->first();
|
return $this->user->tags()->whereNotNull('date')->orderBy('date', 'DESC')->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,6 +253,7 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function oldestTag(): ?Tag
|
public function oldestTag(): ?Tag
|
||||||
{
|
{
|
||||||
|
/** @var Tag|null */
|
||||||
return $this->user->tags()->whereNotNull('date')->orderBy('date', 'ASC')->first();
|
return $this->user->tags()->whereNotNull('date')->orderBy('date', 'ASC')->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,7 +365,6 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
];
|
];
|
||||||
// add foreign amount to correct type:
|
// add foreign amount to correct type:
|
||||||
$amount = app('steam')->positive((string)$journal['foreign_amount']);
|
$amount = app('steam')->positive((string)$journal['foreign_amount']);
|
||||||
$type = $journal['transaction_type_type'];
|
|
||||||
if (TransactionType::WITHDRAWAL === $type) {
|
if (TransactionType::WITHDRAWAL === $type) {
|
||||||
$amount = bcmul($amount, '-1');
|
$amount = bcmul($amount, '-1');
|
||||||
}
|
}
|
||||||
@@ -458,6 +452,7 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function getLocation(Tag $tag): ?Location
|
public function getLocation(Tag $tag): ?Location
|
||||||
{
|
{
|
||||||
|
/** @var Location|null */
|
||||||
return $tag->locations()->first();
|
return $tag->locations()->first();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
|||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Laravel\Passport\Passport;
|
use Laravel\Passport\Passport;
|
||||||
use Log;
|
use Log;
|
||||||
use phpseclib\Crypt\RSA as LegacyRSA;
|
|
||||||
use phpseclib3\Crypt\RSA;
|
use phpseclib3\Crypt\RSA;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,21 +112,7 @@ trait CreateStuff
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// switch on class existence.
|
$keys = RSA::createKey(4096);
|
||||||
$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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Log::alert('NO OAuth keys were found. They have been created.');
|
Log::alert('NO OAuth keys were found. They have been created.');
|
||||||
|
|
||||||
|
2
public/v1/css/firefly.css
vendored
2
public/v1/css/firefly.css
vendored
@@ -26,7 +26,7 @@
|
|||||||
input.ti-new-tag-input {
|
input.ti-new-tag-input {
|
||||||
font-size: 14px !important;
|
font-size: 14px !important;
|
||||||
line-height: 1.42857143;
|
line-height: 1.42857143;
|
||||||
color:red; /* color: #555;*/
|
color: #555;
|
||||||
font-family:"Source Sans Pro", "Helvetica Neue",Helvetica,Arial,sans-serif !important;
|
font-family:"Source Sans Pro", "Helvetica Neue",Helvetica,Arial,sans-serif !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<p class="help-block" v-text="$t('firefly.hidden_fields_preferences')"></p>
|
<p class="help-block" v-html="$t('firefly.hidden_fields_preferences')"></p>
|
||||||
<component
|
<component
|
||||||
v-bind:is="dateComponent"
|
v-bind:is="dateComponent"
|
||||||
v-if="this.fields.interest_date" v-model="value.interest_date" :error="error.interest_date"
|
v-if="this.fields.interest_date" v-model="value.interest_date" :error="error.interest_date"
|
||||||
|
Reference in New Issue
Block a user