Use PSR-12 code style

This commit is contained in:
James Cole
2022-10-30 14:24:28 +01:00
parent 2eebcb21f1
commit f53923f16c
187 changed files with 429 additions and 482 deletions

View File

@@ -104,7 +104,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class Account extends Model
{
use SoftDeletes, HasFactory;
use SoftDeletes;
use HasFactory;
/**
* The attributes that should be casted to native types.
@@ -123,7 +124,7 @@ class Account extends Model
/** @var array Fields that can be filled */
protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban'];
/** @var array Hidden from view */
protected $hidden = ['encrypted'];
protected $hidden = ['encrypted'];
private bool $joinedAccountTypes = false;
/**
@@ -146,7 +147,7 @@ class Account extends Model
return $account;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -120,7 +120,7 @@ class Attachment extends Model
return $attachment;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -64,11 +64,10 @@ use Illuminate\Support\Carbon;
*/
class AutoBudget extends Model
{
use SoftDeletes;
public const AUTO_BUDGET_RESET = 1;
public const AUTO_BUDGET_ROLLOVER = 2;
use SoftDeletes;
/**
* @codeCoverageIgnore
* @return BelongsTo

View File

@@ -105,7 +105,7 @@ class AvailableBudget extends Model
return $availableBudget;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -149,7 +149,7 @@ class Bill extends Model
return $bill;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**
@@ -233,7 +233,7 @@ class Bill extends Model
protected function amountMax(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
get: fn ($value) => (string) $value,
);
}
@@ -245,7 +245,7 @@ class Bill extends Model
protected function amountMin(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
get: fn ($value) => (string) $value,
);
}
}

View File

@@ -122,7 +122,7 @@ class Budget extends Model
return $budget;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -100,7 +100,7 @@ class BudgetLimit extends Model
return $budgetLimit;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**
@@ -129,7 +129,7 @@ class BudgetLimit extends Model
protected function amount(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
get: fn ($value) => (string) $value,
);
}
}

View File

@@ -113,7 +113,7 @@ class Category extends Model
return $category;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -99,7 +99,7 @@ class LinkType extends Model
return $linkType;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -63,7 +63,6 @@ use Illuminate\Support\Carbon;
*/
class Location extends Model
{
/**
* The attributes that should be casted to native types.
*
@@ -117,5 +116,4 @@ class Location extends Model
{
return $this->morphTo();
}
}

View File

@@ -98,7 +98,7 @@ class ObjectGroup extends Model
return $objectGroup;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -123,7 +123,7 @@ class PiggyBank extends Model
return $piggyBank;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -107,7 +107,7 @@ class PiggyBankEvent extends Model
protected function amount(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
get: fn ($value) => (string) $value,
);
}
}

View File

@@ -136,7 +136,7 @@ class PiggyBankRepetition extends Model
protected function currentamount(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
get: fn ($value) => (string) $value,
);
}
}

View File

@@ -91,7 +91,7 @@ class Preference extends Model
}
$default = config('firefly.default_preferences');
if (array_key_exists($value, $default)) {
$preference = new Preference;
$preference = new Preference();
$preference->name = $value;
$preference->data = $default[$value];
$preference->user_id = $user->id;
@@ -100,7 +100,7 @@ class Preference extends Model
return $preference;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -139,7 +139,7 @@ class Recurrence extends Model
return $recurrence;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**
@@ -213,5 +213,4 @@ class Recurrence extends Model
{
return $this->belongsTo(User::class);
}
}

View File

@@ -86,5 +86,4 @@ class RecurrenceMeta extends Model
{
return $this->belongsTo(Recurrence::class);
}
}

View File

@@ -62,14 +62,12 @@ 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;
public const WEEKEND_TO_MONDAY = 4;
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*

View File

@@ -86,5 +86,4 @@ class RecurrenceTransactionMeta extends Model
{
return $this->belongsTo(RecurrenceTransaction::class, 'rt_id');
}
}

View File

@@ -120,7 +120,7 @@ class Rule extends Model
return $rule;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -111,7 +111,7 @@ class RuleGroup extends Model
return $ruleGroup;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -122,7 +122,7 @@ class Tag extends Model
return $tag;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -88,7 +88,8 @@ use Illuminate\Database\Eloquent\SoftDeletes;
*/
class Transaction extends Model
{
use SoftDeletes, HasFactory;
use SoftDeletes;
use HasFactory;
/**
* The attributes that should be casted to native types.
@@ -266,7 +267,7 @@ class Transaction extends Model
protected function amount(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
get: fn ($value) => (string) $value,
);
}
@@ -278,7 +279,7 @@ class Transaction extends Model
protected function foreignAmount(): Attribute
{
return Attribute::make(
get: fn($value) => (string) $value,
get: fn ($value) => (string) $value,
);
}
}

View File

@@ -103,7 +103,7 @@ class TransactionCurrency extends Model
return $currency;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -106,7 +106,7 @@ class TransactionGroup extends Model
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**
@@ -126,5 +126,4 @@ class TransactionGroup extends Model
{
return $this->belongsTo(User::class);
}
}

View File

@@ -120,7 +120,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class TransactionJournal extends Model
{
use SoftDeletes, HasFactory;
use SoftDeletes;
use HasFactory;
/**
* The attributes that should be casted to native types.
@@ -170,7 +171,7 @@ class TransactionJournal extends Model
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -98,7 +98,7 @@ class TransactionJournalLink extends Model
return $link;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -56,6 +56,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class TransactionType extends Model
{
use SoftDeletes;
public const DEPOSIT = 'Deposit';
public const INVALID = 'Invalid';
public const LIABILITY_CREDIT = 'Liability credit';
@@ -63,7 +64,6 @@ class TransactionType extends Model
public const RECONCILIATION = 'Reconciliation';
public const TRANSFER = 'Transfer';
public const WITHDRAWAL = 'Withdrawal';
use SoftDeletes;
protected $casts
= [

View File

@@ -110,7 +110,7 @@ class Webhook extends Model
return $webhook;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -84,7 +84,7 @@ class WebhookAttempt extends Model
return $attempt;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**

View File

@@ -68,7 +68,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class WebhookMessage extends Model
{
protected $casts
= [
'sent' => 'boolean',
@@ -98,7 +97,7 @@ class WebhookMessage extends Model
return $message;
}
}
throw new NotFoundHttpException;
throw new NotFoundHttpException();
}
/**