mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
Clean up some code
This commit is contained in:
@@ -235,7 +235,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
|||||||
$user = $model->user; // @phpstan-ignore-line
|
$user = $model->user; // @phpstan-ignore-line
|
||||||
// ignore lines about polymorphic calls.
|
// ignore lines about polymorphic calls.
|
||||||
if ($model instanceof PiggyBank) {
|
if ($model instanceof PiggyBank) {
|
||||||
$user = $model->account->user; // @phpstan-ignore-line
|
$user = $model->account->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
$attachment = new Attachment(); // create Attachment object.
|
$attachment = new Attachment(); // create Attachment object.
|
||||||
@@ -374,7 +374,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
|||||||
$count = 0;
|
$count = 0;
|
||||||
// ignore lines about polymorphic calls.
|
// ignore lines about polymorphic calls.
|
||||||
if ($model instanceof PiggyBank) {
|
if ($model instanceof PiggyBank) {
|
||||||
$count = $model->account->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count(); // @phpstan-ignore-line
|
$count = $model->account->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count();
|
||||||
}
|
}
|
||||||
if ($model instanceof PiggyBank) {
|
if ($model instanceof PiggyBank) {
|
||||||
$count = $model->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count(); // @phpstan-ignore-line
|
$count = $model->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count(); // @phpstan-ignore-line
|
||||||
|
@@ -65,7 +65,8 @@ class AccountServiceProvider extends ServiceProvider
|
|||||||
/** @var AccountRepositoryInterface $repository */
|
/** @var AccountRepositoryInterface $repository */
|
||||||
$repository = app(AccountRepository::class);
|
$repository = app(AccountRepository::class);
|
||||||
|
|
||||||
if ($app->auth->check()) {
|
// phpstan thinks auth does not exist.
|
||||||
|
if ($app->auth->check()) { // @phpstan-ignore-line
|
||||||
$repository->setUser(auth()->user());
|
$repository->setUser(auth()->user());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +80,8 @@ class AccountServiceProvider extends ServiceProvider
|
|||||||
/** @var OperationsRepository $repository */
|
/** @var OperationsRepository $repository */
|
||||||
$repository = app(OperationsRepository::class);
|
$repository = app(OperationsRepository::class);
|
||||||
|
|
||||||
if ($app->auth->check()) {
|
// phpstan thinks auth does not exist.
|
||||||
|
if ($app->auth->check()) { // @phpstan-ignore-line
|
||||||
$repository->setUser(auth()->user());
|
$repository->setUser(auth()->user());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +101,8 @@ class AccountServiceProvider extends ServiceProvider
|
|||||||
/** @var AccountTaskerInterface $tasker */
|
/** @var AccountTaskerInterface $tasker */
|
||||||
$tasker = app(AccountTasker::class);
|
$tasker = app(AccountTasker::class);
|
||||||
|
|
||||||
if ($app->auth->check()) {
|
// phpstan thinks auth does not exist.
|
||||||
|
if ($app->auth->check()) { // @phpstan-ignore-line
|
||||||
$tasker->setUser(auth()->user());
|
$tasker->setUser(auth()->user());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
<input v-model=active :name="name" @change="handleInput" type="checkbox" value="1">
|
<input v-model=active :name="name" @change="handleInput" type="checkbox" value="1">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<p class="help-block" v-html="$t('firefly.webhook_active_form_help')"></p>
|
<p class="help-block" v-text="$t('firefly.webhook_active_form_help')"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
:value="delivery.id">{{ delivery.name }}
|
:value="delivery.id">{{ delivery.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<p class="help-block" v-html="$t('firefly.webhook_delivery_form_help')"></p>
|
<p class="help-block" v-text="$t('firefly.webhook_delivery_form_help')"></p>
|
||||||
<ul v-for="error in this.error" class="list-unstyled">
|
<ul v-for="error in this.error" class="list-unstyled">
|
||||||
<li class="text-danger">{{ error }}</li>
|
<li class="text-danger">{{ error }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
:value="response.id">{{ response.name }}
|
:value="response.id">{{ response.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<p class="help-block" v-html="$t('firefly.webhook_response_form_help')"></p>
|
<p class="help-block" v-text="$t('firefly.webhook_response_form_help')"></p>
|
||||||
<ul v-for="error in this.error" class="list-unstyled">
|
<ul v-for="error in this.error" class="list-unstyled">
|
||||||
<li class="text-danger">{{ error }}</li>
|
<li class="text-danger">{{ error }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
:value="trigger.id">{{ trigger.name }}
|
:value="trigger.id">{{ trigger.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<p class="help-block" v-html="$t('firefly.webhook_trigger_form_help')"></p>
|
<p class="help-block" v-text="$t('firefly.webhook_trigger_form_help')"></p>
|
||||||
<ul v-for="error in this.error" class="list-unstyled">
|
<ul v-for="error in this.error" class="list-unstyled">
|
||||||
<li class="text-danger">{{ error }}</li>
|
<li class="text-danger">{{ error }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
:value="cBill.id">{{ cBill.name }}
|
:value="cBill.id">{{ cBill.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<p v-if="this.bills.length === 1" class="help-block" v-html="$t('firefly.no_bill_pointer')"></p>
|
<p v-if="this.bills.length === 1" class="help-block" v-text="$t('firefly.no_bill_pointer')"></p>
|
||||||
<ul v-for="error in this.error" class="list-unstyled">
|
<ul v-for="error in this.error" class="list-unstyled">
|
||||||
<li class="text-danger">{{ error }}</li>
|
<li class="text-danger">{{ error }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
:value="cBudget.id">{{ cBudget.name }}
|
:value="cBudget.id">{{ cBudget.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<p v-if="this.budgets.length === 1" class="help-block" v-html="$t('firefly.no_budget_pointer')"></p>
|
<p v-if="this.budgets.length === 1" class="help-block" v-text="$t('firefly.no_budget_pointer')"></p>
|
||||||
<ul v-for="error in this.error" class="list-unstyled">
|
<ul v-for="error in this.error" class="list-unstyled">
|
||||||
<li class="text-danger">{{ error }}</li>
|
<li class="text-danger">{{ error }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<p class="help-block" v-html="$t('firefly.hidden_fields_preferences')"></p>
|
<p class="help-block" v-text="$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"
|
||||||
|
@@ -85,7 +85,7 @@
|
|||||||
<table class="table table-hover" aria-label="A table">
|
<table class="table table-hover" aria-label="A table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width:40%;">{{ $t('list.url') }}</th>
|
<th scope="row" style="width:40%;">{{ $t('list.url') }}</th>
|
||||||
<td><input type="text" readonly class="form-control" :value=url></td>
|
<td><input type="text" readonly class="form-control" :value=url></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
Reference in New Issue
Block a user