mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix phpstan issues.
This commit is contained in:
@@ -34,6 +34,7 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\View\View;
|
||||
|
||||
use Safe\Exceptions\UrlException;
|
||||
use function Safe\parse_url;
|
||||
|
||||
/**
|
||||
@@ -103,8 +104,12 @@ class ForgotPasswordController extends Controller
|
||||
*/
|
||||
private function validateHost(): void
|
||||
{
|
||||
$configuredHost = parse_url((string) config('app.url'), PHP_URL_HOST);
|
||||
if (false === $configuredHost || null === $configuredHost) {
|
||||
try {
|
||||
$configuredHost = parse_url((string)config('app.url'), PHP_URL_HOST);
|
||||
} catch (UrlException $e) {
|
||||
throw new FireflyException('Please set a valid and correct Firefly III URL in the APP_URL environment variable.',0, $e);
|
||||
}
|
||||
if (!is_string( $configuredHost)) {
|
||||
throw new FireflyException('Please set a valid and correct Firefly III URL in the APP_URL environment variable.');
|
||||
}
|
||||
$host = request()->host();
|
||||
|
@@ -249,8 +249,8 @@ 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) {
|
||||
|
@@ -330,6 +330,7 @@ class AccountController extends Controller
|
||||
/** @var array $journal */
|
||||
foreach ($journals as $journal) {
|
||||
$key = sprintf('%d-%d', $journal['category_id'], $journal['currency_id']);
|
||||
$field = 'amount';
|
||||
if (!array_key_exists($key, $result)) {
|
||||
|
||||
// currency info:
|
||||
@@ -338,7 +339,6 @@ class AccountController extends Controller
|
||||
$currencySymbol = $journal['currency_symbol'];
|
||||
$currencyCode = $journal['currency_code'];
|
||||
$currencyDecimalPlaces = $journal['currency_decimal_places'];
|
||||
$field = 'amount';
|
||||
if ($this->convertToPrimary && $this->primaryCurrency->id !== $currencyId) {
|
||||
$field = 'pc_amount';
|
||||
$currencyName = $this->primaryCurrency->name;
|
||||
@@ -437,6 +437,7 @@ class AccountController extends Controller
|
||||
/** @var array $journal */
|
||||
foreach ($journals as $journal) {
|
||||
$key = sprintf('%d-%d', $journal['category_id'], $journal['currency_id']);
|
||||
$field = 'amount';
|
||||
if (!array_key_exists($key, $result)) {
|
||||
|
||||
// currency info:
|
||||
@@ -445,7 +446,6 @@ class AccountController extends Controller
|
||||
$currencySymbol = $journal['currency_symbol'];
|
||||
$currencyCode = $journal['currency_code'];
|
||||
$currencyDecimalPlaces = $journal['currency_decimal_places'];
|
||||
$field = 'amount';
|
||||
if ($this->convertToPrimary && $this->primaryCurrency->id !== $currencyId) {
|
||||
$field = 'pc_amount';
|
||||
$currencyName = $this->primaryCurrency->name;
|
||||
|
Reference in New Issue
Block a user