mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 16:40:10 +00:00
Fix phpstan issues.
This commit is contained in:
@@ -158,7 +158,7 @@ class CreateController extends Controller
|
||||
}
|
||||
|
||||
// store attachment(s):
|
||||
/** @var array $files */
|
||||
/** @var array|null $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
if (null !== $files && !auth()->user()->hasRole('demo')) {
|
||||
$this->attachments->saveAttachmentsForModel($account, $files);
|
||||
|
||||
@@ -79,7 +79,7 @@ class ForgotPasswordController extends Controller
|
||||
$this->validateEmail($request);
|
||||
|
||||
// verify if the user is not a demo user. If so, we give him back an error.
|
||||
/** @var User $user */
|
||||
/** @var User|null $user */
|
||||
$user = User::where('email', $request->get('email'))->first();
|
||||
|
||||
if (null !== $user && $repository->hasRole($user, 'demo')) {
|
||||
|
||||
@@ -97,7 +97,7 @@ class LoginController extends Controller
|
||||
// If the class is using the ThrottlesLogins trait, we can automatically throttle
|
||||
// the login attempts for this application. We'll key this by the username and
|
||||
// the IP address of the client making these requests into this application.
|
||||
if (method_exists($this, 'hasTooManyLoginAttempts') && $this->hasTooManyLoginAttempts($request)) {
|
||||
if ($this->hasTooManyLoginAttempts($request)) {
|
||||
Log::channel('audit')->info(sprintf('Login for user "%s" was locked out.', $request->get($this->username())));
|
||||
app('log')->error(sprintf('Login for user "%s" was locked out.', $request->get($this->username())));
|
||||
$this->fireLockoutEvent($request);
|
||||
|
||||
@@ -114,7 +114,7 @@ class CreateController extends Controller
|
||||
$request->session()->flash('success', (string)trans('firefly.stored_new_bill', ['name' => $bill->name]));
|
||||
app('preferences')->mark();
|
||||
|
||||
/** @var array $files */
|
||||
/** @var array|null $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
if (null !== $files && !auth()->user()->hasRole('demo')) {
|
||||
$this->attachments->saveAttachmentsForModel($bill, $files);
|
||||
|
||||
@@ -128,7 +128,7 @@ class EditController extends Controller
|
||||
$request->session()->flash('success', (string)trans('firefly.updated_bill', ['name' => $bill->name]));
|
||||
app('preferences')->mark();
|
||||
|
||||
/** @var array $files */
|
||||
/** @var array|null $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
if (null !== $files && !auth()->user()->hasRole('demo')) {
|
||||
$this->attachments->saveAttachmentsForModel($bill, $files);
|
||||
|
||||
@@ -90,11 +90,7 @@ class ShowController extends Controller
|
||||
|
||||
return redirect(route('bills.show', [$bill->id]));
|
||||
}
|
||||
$set = new Collection();
|
||||
if (true === $bill->active) {
|
||||
$set = $this->repository->getRulesForBill($bill);
|
||||
$total = 0;
|
||||
}
|
||||
$set = $this->repository->getRulesForBill($bill);
|
||||
if (0 === $set->count()) {
|
||||
$request->session()->flash('error', (string)trans('firefly.no_rules_for_bill'));
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ class CreateController extends Controller
|
||||
app('preferences')->mark();
|
||||
|
||||
// store attachment(s):
|
||||
/** @var array $files */
|
||||
/** @var array|null $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
if (null !== $files && !auth()->user()->hasRole('demo')) {
|
||||
$this->attachments->saveAttachmentsForModel($piggyBank, $files);
|
||||
|
||||
@@ -127,7 +127,7 @@ class EditController extends Controller
|
||||
app('preferences')->mark();
|
||||
|
||||
// store new attachment(s):
|
||||
/** @var array $files */
|
||||
/** @var array|null $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
if (null !== $files && !auth()->user()->hasRole('demo')) {
|
||||
$this->attachments->saveAttachmentsForModel($piggyBank, $files);
|
||||
|
||||
@@ -241,7 +241,7 @@ class CreateController extends Controller
|
||||
app('preferences')->mark();
|
||||
|
||||
// store attachment(s):
|
||||
/** @var array $files */
|
||||
/** @var array|null $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
if (null !== $files && !auth()->user()->hasRole('demo')) {
|
||||
$this->attachments->saveAttachmentsForModel($recurrence, $files);
|
||||
|
||||
@@ -327,7 +327,7 @@ class TagController extends Controller
|
||||
app('preferences')->mark();
|
||||
|
||||
// store attachment(s):
|
||||
/** @var array $files */
|
||||
/** @var array|null $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
if (null !== $files && !auth()->user()->hasRole('demo')) {
|
||||
$this->attachmentsHelper->saveAttachmentsForModel($result, $files);
|
||||
@@ -366,7 +366,7 @@ class TagController extends Controller
|
||||
app('preferences')->mark();
|
||||
|
||||
// store new attachment(s):
|
||||
/** @var array $files */
|
||||
/** @var array|null $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
if (null !== $files && !auth()->user()->hasRole('demo')) {
|
||||
$this->attachmentsHelper->saveAttachmentsForModel($tag, $files);
|
||||
|
||||
@@ -106,7 +106,7 @@ class MassController extends Controller
|
||||
/** @var string $journalId */
|
||||
foreach ($ids as $journalId) {
|
||||
app('log')->debug(sprintf('Searching for ID #%d', $journalId));
|
||||
/** @var TransactionJournal $journal */
|
||||
/** @var TransactionJournal|null $journal */
|
||||
$journal = $this->repository->find((int)$journalId);
|
||||
if (null !== $journal && (int)$journalId === (int)$journal->id) {
|
||||
$this->repository->destroyJournal($journal);
|
||||
|
||||
Reference in New Issue
Block a user