More phpstan issues fixed.

This commit is contained in:
James Cole
2023-11-05 09:54:53 +01:00
parent 1b978d41e0
commit 2d5790c417
73 changed files with 142 additions and 574 deletions

View File

@@ -111,11 +111,7 @@ class Account extends Model
use HasFactory;
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -125,9 +121,9 @@ class Account extends Model
'active' => 'boolean',
'encrypted' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable = ['user_id', 'user_group_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban'];
/** @var array Hidden from view */
protected $hidden = ['encrypted'];
private bool $joinedAccountTypes = false;

View File

@@ -52,17 +52,13 @@ use Carbon\Carbon;
*/
class AccountMeta extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/** @var array Fields that can be filled */
protected $fillable = ['account_id', 'name', 'data'];
/** @var string The table to store the data in */
protected $table = 'account_meta';

View File

@@ -66,17 +66,13 @@ class AccountType extends Model
public const REVENUE = 'Revenue account';
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/** @var array Fields that can be filled */
protected $fillable = ['type'];
/**

View File

@@ -86,11 +86,7 @@ class Attachment extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -98,7 +94,7 @@ class Attachment extends Model
'deleted_at' => 'datetime',
'uploaded' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable = ['attachable_id', 'attachable_type', 'user_id', 'md5', 'filename', 'mime', 'title', 'description', 'size', 'uploaded'];
/**

View File

@@ -70,11 +70,7 @@ class AvailableBudget extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -84,7 +80,7 @@ class AvailableBudget extends Model
'end_date' => 'date',
'transaction_currency_id' => 'int',
];
/** @var array Fields that can be filled */
protected $fillable = ['user_id', 'user_group_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date'];
/**

View File

@@ -105,11 +105,7 @@ class Bill extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -125,7 +121,7 @@ class Bill extends Model
'match_encrypted' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable
= [
'name',
@@ -143,7 +139,7 @@ class Bill extends Model
'end_date',
'extension_date',
];
/** @var array Hidden from view */
protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted'];
/**

View File

@@ -85,11 +85,7 @@ class Budget extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -98,9 +94,9 @@ class Budget extends Model
'active' => 'boolean',
'encrypted' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable = ['user_id', 'name', 'active', 'order', 'user_group_id'];
/** @var array Hidden from view */
protected $hidden = ['encrypted'];
/**

View File

@@ -67,11 +67,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class BudgetLimit extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -86,7 +82,7 @@ class BudgetLimit extends Model
'updated' => Updated::class,
'deleted' => Deleted::class,
];
/** @var array Fields that can be filled */
protected $fillable = ['budget_id', 'start_date', 'end_date', 'amount', 'transaction_currency_id'];
/**

View File

@@ -76,11 +76,7 @@ class Category extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -88,9 +84,9 @@ class Category extends Model
'deleted_at' => 'datetime',
'encrypted' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable = ['user_id', 'user_group_id', 'name'];
/** @var array Hidden from view */
protected $hidden = ['encrypted'];
/**

View File

@@ -56,11 +56,7 @@ class Configuration extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',

View File

@@ -66,11 +66,7 @@ class LinkType extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -79,7 +75,7 @@ class LinkType extends Model
'editable' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable = ['name', 'inward', 'outward', 'editable'];
/**

View File

@@ -63,11 +63,7 @@ use Carbon\Carbon;
*/
class Location extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -77,7 +73,7 @@ class Location extends Model
'latitude' => 'float',
'longitude' => 'float',
];
/** @var array Fields that can be filled */
protected $fillable = ['locatable_id', 'locatable_type', 'latitude', 'longitude', 'zoom_level'];
/**

View File

@@ -62,18 +62,14 @@ class Note extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
];
/** @var array Fields that can be filled */
protected $fillable = ['title', 'text', 'noteable_id', 'noteable_type'];
/**

View File

@@ -67,11 +67,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class ObjectGroup extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',

View File

@@ -102,9 +102,9 @@ class PiggyBank extends Model
'active' => 'boolean',
'encrypted' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable = ['name', 'account_id', 'order', 'targetamount', 'startdate', 'targetdate', 'active'];
/** @var array Hidden from view */
protected $hidden = ['targetamount_encrypted', 'encrypted'];
/**

View File

@@ -56,20 +56,16 @@ use Carbon\Carbon;
*/
class PiggyBankEvent extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
'date' => 'date',
];
/** @var array Fields that can be filled */
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];
/** @var array Hidden from view */
protected $hidden = ['amount_encrypted'];
/**

View File

@@ -57,11 +57,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
*/
class PiggyBankRepetition extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -69,7 +65,7 @@ class PiggyBankRepetition extends Model
'startdate' => 'date',
'targetdate' => 'date',
];
/** @var array Fields that can be filled */
protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount'];
/**

View File

@@ -54,11 +54,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class Preference extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -66,7 +62,7 @@ class Preference extends Model
'data' => 'array',
];
/** @var array Fields that can be filled */
protected $fillable = ['user_id', 'data', 'name'];
/**

View File

@@ -93,11 +93,7 @@ class Recurrence extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -113,7 +109,7 @@ class Recurrence extends Model
'active' => 'bool',
'apply_rules' => 'bool',
];
/** @var array Fields that can be filled */
protected $fillable
= ['user_id', 'transaction_type_id', 'title', 'description', 'first_date', 'repeat_until', 'latest_date', 'repetitions', 'apply_rules', 'active'];
/** @var string The table to store the data in */

View File

@@ -60,11 +60,7 @@ class RecurrenceMeta extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -73,7 +69,7 @@ class RecurrenceMeta extends Model
'name' => 'string',
'value' => 'string',
];
/** @var array Fields that can be filled */
protected $fillable = ['recurrence_id', 'name', 'value'];
/** @var string The table to store the data in */
protected $table = 'recurrences_meta';

View File

@@ -69,11 +69,7 @@ class RecurrenceRepetition extends Model
public const WEEKEND_TO_FRIDAY = 3;
public const WEEKEND_TO_MONDAY = 4;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -84,7 +80,7 @@ class RecurrenceRepetition extends Model
'repetition_skip' => 'int',
'weekend' => 'int',
];
/** @var array Fields that can be filled */
protected $fillable = ['recurrence_id', 'weekend', 'repetition_type', 'repetition_moment', 'repetition_skip'];
/** @var string The table to store the data in */
protected $table = 'recurrences_repetitions';

View File

@@ -82,11 +82,7 @@ class RecurrenceTransaction extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -96,7 +92,7 @@ class RecurrenceTransaction extends Model
'foreign_amount' => 'string',
'description' => 'string',
];
/** @var array Fields that can be filled */
protected $fillable
= [
'recurrence_id',

View File

@@ -60,11 +60,7 @@ class RecurrenceTransactionMeta extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -73,7 +69,7 @@ class RecurrenceTransactionMeta extends Model
'name' => 'string',
'value' => 'string',
];
/** @var array Fields that can be filled */
protected $fillable = ['rt_id', 'name', 'value'];
/** @var string The table to store the data in */
protected $table = 'rt_meta';

View File

@@ -55,18 +55,14 @@ use Carbon\Carbon;
*/
class Role extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/** @var array Fields that can be filled */
protected $fillable = ['name', 'display_name', 'description'];
/**

View File

@@ -83,11 +83,7 @@ class Rule extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -99,7 +95,7 @@ class Rule extends Model
'id' => 'int',
'strict' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable = ['rule_group_id', 'order', 'active', 'title', 'description', 'user_id', 'strict'];
/**

View File

@@ -58,11 +58,7 @@ use Carbon\Carbon;
*/
class RuleAction extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -72,7 +68,7 @@ class RuleAction extends Model
'stop_processing' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable = ['rule_id', 'action_type', 'action_value', 'order', 'active', 'stop_processing'];
/**

View File

@@ -74,11 +74,7 @@ class RuleGroup extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -89,7 +85,7 @@ class RuleGroup extends Model
'order' => 'int',
];
/** @var array Fields that can be filled */
protected $fillable = ['user_id', 'user_group_id', 'stop_processing', 'order', 'title', 'description', 'active'];
/**

View File

@@ -58,11 +58,7 @@ use Carbon\Carbon;
*/
class RuleTrigger extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -72,7 +68,7 @@ class RuleTrigger extends Model
'stop_processing' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable = ['rule_id', 'trigger_type', 'trigger_value', 'order', 'active', 'stop_processing'];
/**

View File

@@ -83,11 +83,7 @@ class Tag extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -98,7 +94,7 @@ class Tag extends Model
'latitude' => 'float',
'longitude' => 'float',
];
/** @var array Fields that can be filled */
protected $fillable = ['user_id', 'user_group_id', 'tag', 'date', 'description', 'tagMode'];
protected $hidden = ['zoomLevel', 'latitude', 'longitude'];

View File

@@ -92,11 +92,7 @@ class Transaction extends Model
use HasFactory;
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -107,7 +103,7 @@ class Transaction extends Model
'bill_name_encrypted' => 'boolean',
'reconciled' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable
= [
'account_id',
@@ -120,7 +116,7 @@ class Transaction extends Model
'foreign_amount',
'reconciled',
];
/** @var array Hidden from view */
protected $hidden = ['encrypted'];
/**

View File

@@ -82,11 +82,7 @@ class TransactionCurrency extends Model
public ?bool $userEnabled;
public ?bool $userDefault;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -95,7 +91,7 @@ class TransactionCurrency extends Model
'decimal_places' => 'int',
'enabled' => 'bool',
];
/** @var array Fields that can be filled */
protected $fillable = ['name', 'code', 'symbol', 'decimal_places', 'enabled'];
/**

View File

@@ -67,11 +67,7 @@ class TransactionGroup extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'id' => 'integer',
@@ -82,7 +78,7 @@ class TransactionGroup extends Model
'date' => 'datetime',
];
/** @var array Fields that can be filled */
protected $fillable = ['user_id', 'user_group_id', 'title'];
/**

View File

@@ -126,11 +126,7 @@ class TransactionJournal extends Model
use HasFactory;
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
@@ -146,7 +142,7 @@ class TransactionJournal extends Model
'completed' => 'boolean',
];
/** @var array Fields that can be filled */
protected $fillable
= [
'user_id',
@@ -160,7 +156,7 @@ class TransactionJournal extends Model
'order',
'date',
];
/** @var array Hidden from view */
protected $hidden = ['encrypted'];
/**

View File

@@ -63,11 +63,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class TransactionJournalLink extends Model
{
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',

View File

@@ -62,18 +62,14 @@ class TransactionJournalMeta extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
];
/** @var array Fields that can be filled */
protected $fillable = ['transaction_journal_id', 'name', 'data', 'hash'];
/** @var string The table to store the data in */
protected $table = 'journal_meta';