mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Fix various code style issues.
This commit is contained in:
@@ -61,7 +61,7 @@ class Account extends Model
|
||||
public static function firstOrCreateEncrypted(array $fields)
|
||||
{
|
||||
// everything but the name:
|
||||
$query = Account::orderBy('id');
|
||||
$query = self::orderBy('id');
|
||||
$search = $fields;
|
||||
unset($search['name'], $search['iban']);
|
||||
|
||||
@@ -81,7 +81,7 @@ class Account extends Model
|
||||
}
|
||||
|
||||
// create it!
|
||||
$account = Account::create($fields);
|
||||
$account = self::create($fields);
|
||||
|
||||
return $account;
|
||||
|
||||
|
@@ -43,7 +43,7 @@ class Budget extends Model
|
||||
public static function firstOrCreateEncrypted(array $fields)
|
||||
{
|
||||
// everything but the name:
|
||||
$query = Budget::orderBy('id');
|
||||
$query = self::orderBy('id');
|
||||
$search = $fields;
|
||||
unset($search['name']);
|
||||
foreach ($search as $name => $value) {
|
||||
@@ -57,7 +57,7 @@ class Budget extends Model
|
||||
}
|
||||
}
|
||||
// create it!
|
||||
$budget = Budget::create($fields);
|
||||
$budget = self::create($fields);
|
||||
|
||||
return $budget;
|
||||
|
||||
|
@@ -42,7 +42,7 @@ class Category extends Model
|
||||
public static function firstOrCreateEncrypted(array $fields)
|
||||
{
|
||||
// everything but the name:
|
||||
$query = Category::orderBy('id');
|
||||
$query = self::orderBy('id');
|
||||
$search = $fields;
|
||||
unset($search['name']);
|
||||
foreach ($search as $name => $value) {
|
||||
@@ -56,7 +56,7 @@ class Category extends Model
|
||||
}
|
||||
}
|
||||
// create it!
|
||||
$category = Category::create($fields);
|
||||
$category = self::create($fields);
|
||||
|
||||
return $category;
|
||||
|
||||
|
@@ -37,7 +37,7 @@ class LimitRepetition extends Model
|
||||
public static function routeBinder($value)
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$object = LimitRepetition::where('limit_repetitions.id', $value)
|
||||
$object = self::where('limit_repetitions.id', $value)
|
||||
->leftJoin('budget_limits', 'budget_limits.id', '=', 'limit_repetitions.budget_limit_id')
|
||||
->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
|
||||
->where('budgets.user_id', auth()->user()->id)
|
||||
|
@@ -43,7 +43,7 @@ class Tag extends TagSupport
|
||||
$search = $fields;
|
||||
unset($search['tag']);
|
||||
|
||||
$query = Tag::orderBy('id');
|
||||
$query = self::orderBy('id');
|
||||
foreach ($search as $name => $value) {
|
||||
$query->where($name, $value);
|
||||
}
|
||||
@@ -57,7 +57,7 @@ class Tag extends TagSupport
|
||||
// create it!
|
||||
$fields['tagMode'] = 'nothing';
|
||||
$fields['description'] = $fields['description'] ?? '';
|
||||
$tag = Tag::create($fields);
|
||||
$tag = self::create($fields);
|
||||
|
||||
return $tag;
|
||||
|
||||
|
@@ -64,7 +64,7 @@ class TransactionJournal extends TransactionJournalSupport
|
||||
public static function routeBinder($value)
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$object = TransactionJournal::where('transaction_journals.id', $value)
|
||||
$object = self::where('transaction_journals.id', $value)
|
||||
->with('transactionType')
|
||||
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->where('user_id', auth()->user()->id)->first(['transaction_journals.*']);
|
||||
|
@@ -57,7 +57,7 @@ class TransactionType extends Model
|
||||
*/
|
||||
public function isDeposit()
|
||||
{
|
||||
return $this->type === TransactionType::DEPOSIT;
|
||||
return $this->type === self::DEPOSIT;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ class TransactionType extends Model
|
||||
*/
|
||||
public function isOpeningBalance()
|
||||
{
|
||||
return $this->type === TransactionType::OPENING_BALANCE;
|
||||
return $this->type === self::OPENING_BALANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,7 +73,7 @@ class TransactionType extends Model
|
||||
*/
|
||||
public function isTransfer()
|
||||
{
|
||||
return $this->type === TransactionType::TRANSFER;
|
||||
return $this->type === self::TRANSFER;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +81,7 @@ class TransactionType extends Model
|
||||
*/
|
||||
public function isWithdrawal()
|
||||
{
|
||||
return $this->type === TransactionType::WITHDRAWAL;
|
||||
return $this->type === self::WITHDRAWAL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user