mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
Code cleanup and realign.
This commit is contained in:
@@ -35,32 +35,32 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
*/
|
||||
class AccountType extends Model
|
||||
{
|
||||
/** @var string */
|
||||
public const DEFAULT = 'Default account';
|
||||
/** @var string */
|
||||
public const CASH = 'Cash account';
|
||||
/** @var string */
|
||||
public const ASSET = 'Asset account';
|
||||
/** @var string */
|
||||
public const EXPENSE = 'Expense account';
|
||||
/** @var string */
|
||||
public const REVENUE = 'Revenue account';
|
||||
/** @var string */
|
||||
/** @var string */
|
||||
public const DEFAULT = 'Default account';
|
||||
/** @var string */
|
||||
public const CASH = 'Cash account';
|
||||
/** @var string */
|
||||
public const ASSET = 'Asset account';
|
||||
/** @var string */
|
||||
public const EXPENSE = 'Expense account';
|
||||
/** @var string */
|
||||
public const REVENUE = 'Revenue account';
|
||||
/** @var string */
|
||||
public const INITIAL_BALANCE = 'Initial balance account';
|
||||
/** @var string */
|
||||
public const BENEFICIARY = 'Beneficiary account';
|
||||
/** @var string */
|
||||
public const IMPORT = 'Import account';
|
||||
/** @var string */
|
||||
public const RECONCILIATION = 'Reconciliation account';
|
||||
/** @var string */
|
||||
public const LOAN = 'Loan';
|
||||
/** @var string */
|
||||
public const DEBT = 'Debt';
|
||||
/** @var string */
|
||||
public const MORTGAGE = 'Mortgage';
|
||||
/** @var string */
|
||||
public const CREDITCARD = 'Credit card';
|
||||
/** @var string */
|
||||
public const BENEFICIARY = 'Beneficiary account';
|
||||
/** @var string */
|
||||
public const IMPORT = 'Import account';
|
||||
/** @var string */
|
||||
public const RECONCILIATION = 'Reconciliation account';
|
||||
/** @var string */
|
||||
public const LOAN = 'Loan';
|
||||
/** @var string */
|
||||
public const DEBT = 'Debt';
|
||||
/** @var string */
|
||||
public const MORTGAGE = 'Mortgage';
|
||||
/** @var string */
|
||||
public const CREDITCARD = 'Credit card';
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
|
@@ -84,7 +84,7 @@ class Attachment extends Model
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var Attachment $attachment */
|
||||
$attachment = $user->attachments()->find($attachmentId);
|
||||
$attachment = $user->attachments()->find($attachmentId);
|
||||
if (null !== $attachment) {
|
||||
return $attachment;
|
||||
}
|
||||
|
@@ -76,7 +76,7 @@ class AvailableBudget extends Model
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var AvailableBudget $availableBudget */
|
||||
$availableBudget = $user->availableBudgets()->find($availableBudgetId);
|
||||
$availableBudget = $user->availableBudgets()->find($availableBudgetId);
|
||||
if (null !== $availableBudget) {
|
||||
return $availableBudget;
|
||||
}
|
||||
|
@@ -110,9 +110,9 @@ class Bill extends Model
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
* @return MorphMany
|
||||
*/
|
||||
public function attachments(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
public function attachments(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Attachment::class, 'attachable');
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property int $user_id
|
||||
* @property-read string $email
|
||||
* @property bool encrypted
|
||||
* @property Collection budgetlimits
|
||||
* @property Collection budgetlimits
|
||||
*/
|
||||
class Budget extends Model
|
||||
{
|
||||
@@ -80,7 +80,7 @@ class Budget extends Model
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var Budget $budget */
|
||||
$budget = $user->budgets()->find($budgetId);
|
||||
$budget = $user->budgets()->find($budgetId);
|
||||
if (null !== $budget) {
|
||||
return $budget;
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ class BudgetLimit extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts
|
||||
= [
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'start_date' => 'date',
|
||||
|
@@ -39,7 +39,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property int $id
|
||||
* @property float $spent // used in category reports
|
||||
* @property Carbon|null lastActivity
|
||||
* @property bool encrypted
|
||||
* @property bool encrypted
|
||||
*/
|
||||
class Category extends Model
|
||||
{
|
||||
@@ -77,7 +77,7 @@ class Category extends Model
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var Category $category */
|
||||
$category = $user->categories()->find($categoryId);
|
||||
$category = $user->categories()->find($categoryId);
|
||||
if (null !== $category) {
|
||||
return $category;
|
||||
}
|
||||
|
@@ -46,8 +46,8 @@ class CurrencyExchangeRate extends Model
|
||||
/** @var array Convert these fields to other data types */
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'user_id' => 'int',
|
||||
'from_currency_id' => 'int',
|
||||
'to_currency_id' => 'int',
|
||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Models;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
@@ -43,7 +44,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property Tag $tag
|
||||
* @property array $errors
|
||||
* @property array extended_status
|
||||
* @property int id
|
||||
* @property int id
|
||||
*/
|
||||
class ImportJob extends Model
|
||||
{
|
||||
@@ -77,7 +78,7 @@ class ImportJob extends Model
|
||||
public static function routeBinder(string $value): ImportJob
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$key = trim($value);
|
||||
$key = trim($value);
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var ImportJob $importJob */
|
||||
@@ -91,9 +92,9 @@ class ImportJob extends Model
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
* @return MorphMany
|
||||
*/
|
||||
public function attachments(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
public function attachments(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Attachment::class, 'attachable');
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property int $order
|
||||
* @property bool $active
|
||||
* @property int $account_id
|
||||
* @property bool encrypted
|
||||
* @property bool encrypted
|
||||
*
|
||||
*/
|
||||
class PiggyBank extends Model
|
||||
|
@@ -33,7 +33,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property int $transaction_journal_id
|
||||
* @property int $piggy_bank_id
|
||||
* @property int $id
|
||||
* @property Carbon date
|
||||
* @property Carbon date
|
||||
*/
|
||||
class PiggyBankEvent extends Model
|
||||
{
|
||||
|
@@ -41,7 +41,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property Carbon $updated_at
|
||||
* @property Carbon $created_at
|
||||
* @property int $id
|
||||
* @property User user
|
||||
* @property User user
|
||||
*/
|
||||
class Preference extends Model
|
||||
{
|
||||
@@ -74,7 +74,7 @@ class Preference extends Model
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var Preference $preference */
|
||||
$preference = $user->preferences()->find($preferenceId);
|
||||
$preference = $user->preferences()->find($preferenceId);
|
||||
if (null !== $preference) {
|
||||
return $preference;
|
||||
}
|
||||
|
@@ -103,7 +103,7 @@ class Recurrence extends Model
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var Recurrence $recurrence */
|
||||
$recurrence = $user->recurrences()->find($recurrenceId);
|
||||
$recurrence = $user->recurrences()->find($recurrenceId);
|
||||
if (null !== $recurrence) {
|
||||
return $recurrence;
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ class RecurrenceRepetition extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts
|
||||
= [
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
|
@@ -43,7 +43,7 @@ class RecurrenceTransactionMeta extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts
|
||||
= [
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
|
@@ -88,7 +88,7 @@ class Rule extends Model
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var Rule $rule */
|
||||
$rule = $user->rules()->find($ruleId);
|
||||
$rule = $user->rules()->find($ruleId);
|
||||
if (null !== $rule) {
|
||||
return $rule;
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property int $id
|
||||
* @property int $order
|
||||
* @property Collection $rules
|
||||
* @property string description
|
||||
* @property string description
|
||||
*/
|
||||
class RuleGroup extends Model
|
||||
{
|
||||
@@ -80,7 +80,7 @@ class RuleGroup extends Model
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var RuleGroup $ruleGroup */
|
||||
$ruleGroup = $user->ruleGroups()->find($ruleGroupId);
|
||||
$ruleGroup = $user->ruleGroups()->find($ruleGroupId);
|
||||
if (null !== $ruleGroup) {
|
||||
return $ruleGroup;
|
||||
}
|
||||
|
@@ -237,6 +237,7 @@ class Transaction extends Model
|
||||
|
||||
/**
|
||||
* Check for transactions BEFORE the specified date.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param Builder $query
|
||||
|
@@ -34,7 +34,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property string $symbol
|
||||
* @property int $decimal_places
|
||||
* @property int $id
|
||||
* @property string name
|
||||
* @property string name
|
||||
*
|
||||
*/
|
||||
class TransactionCurrency extends Model
|
||||
|
@@ -150,9 +150,9 @@ class TransactionJournal extends Model
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
* @return MorphMany
|
||||
*/
|
||||
public function attachments(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
public function attachments(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Attachment::class, 'attachable');
|
||||
}
|
||||
|
@@ -45,9 +45,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
*/
|
||||
class TransactionJournalLink extends Model
|
||||
{
|
||||
/** @var string The table to store the data in */
|
||||
protected $table = 'journal_links';
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
@@ -55,9 +52,11 @@ class TransactionJournalLink extends Model
|
||||
*/
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
/** @var string The table to store the data in */
|
||||
protected $table = 'journal_links';
|
||||
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
|
Reference in New Issue
Block a user