Various PSR12 code cleanup

This commit is contained in:
James Cole 2022-12-29 19:42:26 +01:00
parent dbf3e76ecc
commit 6cfdc58cb1
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
415 changed files with 7462 additions and 6874 deletions

View File

@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Repositories\ObjectGroup\OrganisesObjectGroups;
@ -35,6 +36,7 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;
use JsonException;
use Symfony\Component\HttpFoundation\ParameterBag;
/**
@ -75,8 +77,8 @@ class IndexController extends Controller
* @param Request $request
*
* @return Factory|View
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \JsonException
* @throws FireflyException
* @throws JsonException
*/
public function index(Request $request)
{

View File

@ -1,4 +1,5 @@
<?php
/**
* ReportController.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* IndexController.php
* Copyright (c) 2019 james@firefly-iii.org
@ -33,6 +34,8 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Symfony\Component\HttpFoundation\ParameterBag;
/**
@ -75,8 +78,8 @@ class IndexController extends Controller
*
* @return Factory|View
* @throws FireflyException
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function index(Request $request)
{

View File

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* TriggerController.php

View File

@ -1,4 +1,5 @@
<?php
/**
* AccountController.php
* Copyright (c) 2019 james@firefly-iii.org
@ -28,7 +29,6 @@ use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Repositories\Account\AccountTaskerInterface;
use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection;
use JsonException;
use Log;
use Throwable;

View File

@ -1,4 +1,5 @@
<?php
/**
* BalanceController.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -29,7 +29,6 @@ use FireflyIII\Helpers\Report\ReportHelperInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection;
use JsonException;
use Log;
use Throwable;

View File

@ -1,4 +1,5 @@
<?php
/**
* BudgetController.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* CategoryController.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* DoubleController.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* OperationsController.php
* Copyright (c) 2019 james@firefly-iii.org
@ -28,7 +29,6 @@ use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Repositories\Account\AccountTaskerInterface;
use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection;
use JsonException;
use Log;
use Throwable;

View File

@ -26,7 +26,6 @@ namespace FireflyIII\Http\Controllers\Rule;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\RuleFormRequest;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleGroup;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Rule\RuleRepositoryInterface;

View File

@ -1,4 +1,5 @@
<?php
/**
* IndexController.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/*
* HealthcheckController.php
* Copyright (c) 2021 https://github.com/ajgon

View File

@ -1,4 +1,5 @@
<?php
/**
* ConvertController.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -33,6 +33,9 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use JsonException;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/**
* Class CreateController
@ -100,9 +103,9 @@ class CreateController extends Controller
*
* @return Factory|View
* @throws FireflyException
* @throws \JsonException
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @throws JsonException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function create(?string $objectType)
{

View File

@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Events\DestroyedTransactionGroup;
use FireflyIII\Events\UpdatedAccount;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use Carbon\Carbon;
use Exception;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
@ -32,6 +32,8 @@ use FireflyIII\Support\Http\Controllers\PeriodOverview;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request;
use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/**
* Class IndexController
@ -73,9 +75,9 @@ class IndexController extends Controller
* @param Carbon|null $end
*
* @return Factory|View
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function index(Request $request, string $objectType, Carbon $start = null, Carbon $end = null)
{
@ -132,9 +134,9 @@ class IndexController extends Controller
* @param string $objectType
*
* @return Factory|View
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function indexAll(Request $request, string $objectType)
{

View File

@ -1,4 +1,5 @@
<?php
/**
* LinkController.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* MassController.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -41,8 +41,8 @@ use Symfony\Component\HttpFoundation\ParameterBag;
*/
class ShowController extends Controller
{
private TransactionGroupRepositoryInterface $repository;
private ALERepositoryInterface $ALERepository;
private TransactionGroupRepositoryInterface $repository;
/**
* ShowController constructor.
@ -188,12 +188,14 @@ class ShowController extends Controller
'type' => $transaction['source_type'],
'id' => $transaction['source_id'],
'name' => $transaction['source_name'],
'iban' => $transaction['source_iban']];
'iban' => $transaction['source_iban'],
];
$accounts['destination'][] = [
'type' => $transaction['destination_type'],
'id' => $transaction['destination_id'],
'name' => $transaction['destination_name'],
'iban' => $transaction['destination_iban']];
'iban' => $transaction['destination_iban'],
];
}
$accounts['source'] = array_unique($accounts['source'], SORT_REGULAR);

View File

@ -25,7 +25,6 @@ namespace FireflyIII\Http\Controllers\Webhooks;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Webhook;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Redirector;

View File

@ -24,12 +24,9 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Webhooks;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
use FireflyIII\Models\Webhook;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;

View File

@ -52,6 +52,7 @@ class IndexController extends Controller
}
);
}
/**
* Show debug info.
*

View File

@ -24,12 +24,9 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Webhooks;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
use FireflyIII\Models\Webhook;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;

View File

@ -27,7 +27,6 @@ namespace FireflyIII\Http\Middleware;
use FireflyIII\Exceptions\BadHttpHeaderException;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Log;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
/**

View File

@ -1,4 +1,5 @@
<?php
/**
* Binder.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* EncryptCookies.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -189,19 +189,6 @@ class InterestingMessage
return null !== $billId && null !== $message;
}
/**
* @param Request $request
*
* @return bool
*/
private function webhookMessage(Request $request): bool
{
// get parameters from request.
$billId = $request->get('webhook_id');
$message = $request->get('message');
return null !== $billId && null !== $message;
}
/**
* @param Request $request
@ -226,6 +213,20 @@ class InterestingMessage
}
}
/**
* @param Request $request
*
* @return bool
*/
private function webhookMessage(Request $request): bool
{
// get parameters from request.
$billId = $request->get('webhook_id');
$message = $request->get('message');
return null !== $billId && null !== $message;
}
/**
* @param Request $request
*/

View File

@ -1,4 +1,5 @@
<?php
/**
* IsAdmin.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* IsDemoUser.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* Range.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* RedirectIfAuthenticated.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* StartFireflySession.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* TrimStrings.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* TrustProxies.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* VerifyCsrfToken.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* AccountFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* AttachmentFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* BillStoreRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* BillUpdateRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* BudgetFormStoreRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* BudgetFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* BudgetIncomeRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* BulkEditJournalRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* CategoryFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* ConfigurationRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* CurrencyFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* DeleteAccountFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* EmailFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* JournalLinkRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* LinkTypeFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* MassDeleteJournalRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* MassEditJournalRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* NewUserFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* ObjectGroupFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* PiggyBankStoreRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* PiggyBankUpdateRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* ProfileFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* ReportFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* RuleGroupFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* SelectTransactionsRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* TagFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* TestRuleFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* TokenFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* TriggerRecurrenceRequest.php

View File

@ -1,4 +1,5 @@
<?php
/**
* UserFormRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* UserRegistrationRequest.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -61,10 +61,10 @@ class CreateRecurringTransactions implements ShouldQueue
private Carbon $date;
private bool $force;
private TransactionGroupRepositoryInterface $groupRepository;
private JournalRepositoryInterface $journalRepository;
private RecurringRepositoryInterface $repository;
private Collection $recurrences;
private Collection $groups;
private JournalRepositoryInterface $journalRepository;
private Collection $recurrences;
private RecurringRepositoryInterface $repository;
/**
* Create a new job instance.
@ -97,6 +97,14 @@ class CreateRecurringTransactions implements ShouldQueue
Log::debug(sprintf('Created new CreateRecurringTransactions("%s")', $this->date->format('Y-m-d')));
}
/**
* @return Collection
*/
public function getGroups(): Collection
{
return $this->groups;
}
/**
* Execute the job.
*/
@ -520,12 +528,4 @@ class CreateRecurringTransactions implements ShouldQueue
{
$this->recurrences = $recurrences;
}
/**
* @return Collection
*/
public function getGroups(): Collection
{
return $this->groups;
}
}

View File

@ -47,9 +47,9 @@ class DownloadExchangeRates implements ShouldQueue
use Queueable;
use SerializesModels;
private array $active;
private Carbon $date;
private CurrencyRepositoryInterface $repository;
private array $active;
private Collection $users;
/**
@ -91,16 +91,6 @@ class DownloadExchangeRates implements ShouldQueue
}
}
/**
* @param Carbon $date
*/
public function setDate(Carbon $date): void
{
$newDate = clone $date;
$newDate->startOfDay();
$this->date = $newDate;
}
/**
* @param TransactionCurrency $currency
* @return void
@ -185,4 +175,14 @@ class DownloadExchangeRates implements ShouldQueue
}
}
}
/**
* @param Carbon $date
*/
public function setDate(Carbon $date): void
{
$newDate = clone $date;
$newDate->startOfDay();
$this->date = $newDate;
}
}

View File

@ -1,4 +1,5 @@
<?php
/**
* Job.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* MailError.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* AdminTestMail.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* ConfirmEmailChangeMail.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -33,10 +33,10 @@ class InvitationMail extends Mailable
use Queueable;
use SerializesModels;
public string $invitee;
public string $admin;
public string $url;
public string $host;
public string $invitee;
public string $url;
/**
* OAuthTokenCreatedMail constructor.

View File

@ -1,4 +1,5 @@
<?php
/**
* ReportNewJournalsMail.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* UndoEmailChangeMail.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* Account.php
* Copyright (c) 2019 james@firefly-iii.org
@ -150,6 +151,15 @@ class Account extends Model
throw new NotFoundHttpException();
}
/**
* @return BelongsTo
* @codeCoverageIgnore
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* @return BelongsTo
* @codeCoverageIgnore
@ -281,13 +291,4 @@ class Account extends Model
{
return $this->hasMany(Transaction::class);
}
/**
* @return BelongsTo
* @codeCoverageIgnore
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}

View File

@ -1,4 +1,5 @@
<?php
/**
* AccountMeta.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* AccountType.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* Attachment.php
* Copyright (c) 2019 james@firefly-iii.org
@ -123,6 +124,15 @@ class Attachment extends Model
throw new NotFoundHttpException();
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* Get all of the owning attachable models.
*
@ -154,13 +164,4 @@ class Attachment extends Model
{
return $this->morphMany(Note::class, 'noteable');
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}

View File

@ -24,22 +24,47 @@ declare(strict_types=1);
namespace FireflyIII\Models;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Carbon;
/**
* Class AuditLogEntry
*
* @property-read Model|\Eloquent $auditable
* @property-read Model|\Eloquent $changer
* @method static \Illuminate\Database\Eloquent\Builder|AuditLogEntry newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|AuditLogEntry newQuery()
* @property-read Model|Eloquent $auditable
* @property-read Model|Eloquent $changer
* @method static Builder|AuditLogEntry newModelQuery()
* @method static Builder|AuditLogEntry newQuery()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|AuditLogEntry query()
* @method static Builder|AuditLogEntry query()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry withTrashed()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry withoutTrashed()
* @mixin \Eloquent
* @mixin Eloquent
* @property int $id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Carbon|null $deleted_at
* @property int $auditable_id
* @property string $auditable_type
* @property int $changer_id
* @property string $changer_type
* @property string $action
* @property array|null $before
* @property array|null $after
* @method static Builder|AuditLogEntry whereAction($value)
* @method static Builder|AuditLogEntry whereAfter($value)
* @method static Builder|AuditLogEntry whereAuditableId($value)
* @method static Builder|AuditLogEntry whereAuditableType($value)
* @method static Builder|AuditLogEntry whereBefore($value)
* @method static Builder|AuditLogEntry whereChangerId($value)
* @method static Builder|AuditLogEntry whereChangerType($value)
* @method static Builder|AuditLogEntry whereCreatedAt($value)
* @method static Builder|AuditLogEntry whereDeletedAt($value)
* @method static Builder|AuditLogEntry whereId($value)
* @method static Builder|AuditLogEntry whereUpdatedAt($value)
*/
class AuditLogEntry extends Model
{

View File

@ -65,6 +65,7 @@ use Illuminate\Support\Carbon;
class AutoBudget extends Model
{
use SoftDeletes;
public const AUTO_BUDGET_RESET = 1;
public const AUTO_BUDGET_ROLLOVER = 2;

View File

@ -1,4 +1,5 @@
<?php
/**
* AvailableBudget.php
* Copyright (c) 2019 james@firefly-iii.org
@ -112,17 +113,17 @@ class AvailableBudget extends Model
* @codeCoverageIgnore
* @return BelongsTo
*/
public function transactionCurrency(): BelongsTo
public function user(): BelongsTo
{
return $this->belongsTo(TransactionCurrency::class);
return $this->belongsTo(User::class);
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
public function transactionCurrency(): BelongsTo
{
return $this->belongsTo(User::class);
return $this->belongsTo(TransactionCurrency::class);
}
}

View File

@ -1,4 +1,5 @@
<?php
/**
* Bill.php
* Copyright (c) 2019 james@firefly-iii.org
@ -124,8 +125,21 @@ class Bill extends Model
/** @var array Fields that can be filled */
protected $fillable
= ['name', 'match', 'amount_min', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip',
'automatch', 'active', 'transaction_currency_id', 'end_date', 'extension_date'];
= [
'name',
'match',
'amount_min',
'user_id',
'amount_max',
'date',
'repeat_freq',
'skip',
'automatch',
'active',
'transaction_currency_id',
'end_date',
'extension_date',
];
/** @var array Hidden from view */
protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted'];
@ -152,6 +166,15 @@ class Bill extends Model
throw new NotFoundHttpException();
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* @codeCoverageIgnore
* @return MorphMany
@ -216,15 +239,6 @@ class Bill extends Model
return $this->hasMany(TransactionJournal::class);
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* Get the max amount
*

View File

@ -1,4 +1,5 @@
<?php
/**
* Budget.php
* Copyright (c) 2019 james@firefly-iii.org
@ -125,6 +126,15 @@ class Budget extends Model
throw new NotFoundHttpException();
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* @codeCoverageIgnore
* @return MorphMany
@ -178,13 +188,4 @@ class Budget extends Model
{
return $this->belongsToMany(Transaction::class, 'budget_transaction', 'budget_id');
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}

View File

@ -1,4 +1,5 @@
<?php
/**
* BudgetLimit.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -116,6 +116,15 @@ class Category extends Model
throw new NotFoundHttpException();
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* @codeCoverageIgnore
* @return MorphMany
@ -151,13 +160,4 @@ class Category extends Model
{
return $this->belongsToMany(Transaction::class, 'category_transaction', 'category_id');
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}

View File

@ -1,4 +1,5 @@
<?php
/**
* Configuration.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* CurrencyExchangeRate.php
* Copyright (c) 2019 james@firefly-iii.org
@ -24,39 +25,43 @@ namespace FireflyIII\Models;
use Eloquent;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;
/**
* Class CurrencyExchangeRate
*
* @property int $id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string|null $deleted_at
* @property int $user_id
* @property int $from_currency_id
* @property int $to_currency_id
* @property \Illuminate\Support\Carbon $date
* @property Carbon $date
* @property string $rate
* @property string|null $user_rate
* @property-read \FireflyIII\Models\TransactionCurrency $fromCurrency
* @property-read \FireflyIII\Models\TransactionCurrency $toCurrency
* @property-read TransactionCurrency $fromCurrency
* @property-read TransactionCurrency $toCurrency
* @property-read User $user
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate query()
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereDeletedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereFromCurrencyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereRate($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereToCurrencyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereUserRate($value)
* @method static Builder|CurrencyExchangeRate newModelQuery()
* @method static Builder|CurrencyExchangeRate newQuery()
* @method static Builder|CurrencyExchangeRate query()
* @method static Builder|CurrencyExchangeRate whereCreatedAt($value)
* @method static Builder|CurrencyExchangeRate whereDate($value)
* @method static Builder|CurrencyExchangeRate whereDeletedAt($value)
* @method static Builder|CurrencyExchangeRate whereFromCurrencyId($value)
* @method static Builder|CurrencyExchangeRate whereId($value)
* @method static Builder|CurrencyExchangeRate whereRate($value)
* @method static Builder|CurrencyExchangeRate whereToCurrencyId($value)
* @method static Builder|CurrencyExchangeRate whereUpdatedAt($value)
* @method static Builder|CurrencyExchangeRate whereUserId($value)
* @method static Builder|CurrencyExchangeRate whereUserRate($value)
* @mixin Eloquent
* @property int|null $user_group_id
* @method static Builder|CurrencyExchangeRate whereUserGroupId($value)
*/
class CurrencyExchangeRate extends Model
{

View File

@ -24,28 +24,46 @@ declare(strict_types=1);
namespace FireflyIII\Models;
use Eloquent;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;
/**
* Class InvitedUser
*
* @property-read User $user
* @method static \Illuminate\Database\Eloquent\Builder|InvitedUser newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|InvitedUser newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|InvitedUser query()
* @mixin \Eloquent
* @method static Builder|InvitedUser newModelQuery()
* @method static Builder|InvitedUser newQuery()
* @method static Builder|InvitedUser query()
* @mixin Eloquent
* @property int $id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property int $user_id
* @property string $email
* @property string $invite_code
* @property Carbon $expires
* @property bool $redeemed
* @method static Builder|InvitedUser whereCreatedAt($value)
* @method static Builder|InvitedUser whereEmail($value)
* @method static Builder|InvitedUser whereExpires($value)
* @method static Builder|InvitedUser whereId($value)
* @method static Builder|InvitedUser whereInviteCode($value)
* @method static Builder|InvitedUser whereRedeemed($value)
* @method static Builder|InvitedUser whereUpdatedAt($value)
* @method static Builder|InvitedUser whereUserId($value)
*/
class InvitedUser extends Model
{
protected $fillable = ['user_id', 'email', 'invite_code', 'expires', 'redeemed'];
protected $casts
= [
'expires' => 'datetime',
'redeemed' => 'boolean',
];
protected $fillable = ['user_id', 'email', 'invite_code', 'expires', 'redeemed'];
/**
* @codeCoverageIgnore

View File

@ -1,4 +1,5 @@
<?php
/**
* LinkType.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* Note.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -101,6 +101,15 @@ class ObjectGroup extends Model
throw new NotFoundHttpException();
}
/**
* @return BelongsTo
* @codeCoverageIgnore
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* @return MorphToMany
*/
@ -124,13 +133,4 @@ class ObjectGroup extends Model
{
return $this->morphedByMany(PiggyBank::class, 'object_groupable');
}
/**
* @return BelongsTo
* @codeCoverageIgnore
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}

View File

@ -1,4 +1,5 @@
<?php
/**
* PiggyBank.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* PiggyBankEvent.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* PiggyBankRepetition.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -1,4 +1,5 @@
<?php
/**
* Preference.php
* Copyright (c) 2019 james@firefly-iii.org

View File

@ -142,6 +142,15 @@ class Recurrence extends Model
throw new NotFoundHttpException();
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* @codeCoverageIgnore
* @return MorphMany
@ -204,13 +213,4 @@ class Recurrence extends Model
{
return $this->belongsTo(TransactionType::class);
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}

View File

@ -63,6 +63,7 @@ use Illuminate\Support\Carbon;
class RecurrenceRepetition extends Model
{
use SoftDeletes;
public const WEEKEND_DO_NOTHING = 1;
public const WEEKEND_SKIP_CREATION = 2;
public const WEEKEND_TO_FRIDAY = 3;

Some files were not shown because too many files have changed in this diff Show More