More phpstan issues fixed.

This commit is contained in:
James Cole 2023-11-05 09:54:53 +01:00
parent 1b978d41e0
commit 2d5790c417
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
73 changed files with 142 additions and 574 deletions

View File

@ -1009,5 +1009,5 @@
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.3.0"
"plugin-api-version": "2.6.0"
}

View File

@ -44,21 +44,25 @@ phpmd database,app,tests html /gdrive-all/development/phpmd/phpmd.xml > public/r
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
<properties>
<property name="reportLevel" value="5"/>
<!-- TODO we want to be at report level 5. But we start high, and drop the bar slowly. -->
<property name="reportLevel" value="500"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/NPathComplexity">
<properties>
<property name="minimum" value="128"/>
<!-- TODO we want to be at a value of 128. But we start high, and drop the bar slowly. -->
<property name="minimum" value="2048"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
<properties>
<property name="minimum" value="40"/>
<!-- TODO we want to be at a value of 40. But we start high, and drop the bar slowly. -->
<property name="minimum" value="400"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveParameterList">
<properties>
<!-- TODO we want to be at a value of 4. But we start high, and drop the bar slowly. -->
<property name="minimum" value="5"/>
</properties>
</rule>

View File

@ -10,17 +10,8 @@ use Illuminate\Console\Command;
*/
class CorrectionSkeleton extends Command
{
/**
* The console command description.
*
* @var string
*/
protected $description = 'DESCRIPTION HERE';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:CORR_COMMAND';
/**

View File

@ -36,17 +36,8 @@ class CreateAccessTokens extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Creates user access tokens which are used for command line access to personal data.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:create-access-tokens';
/**

View File

@ -34,17 +34,8 @@ class CreateLinkTypes extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Creates all link types.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:create-link-types';
/**

View File

@ -37,17 +37,8 @@ class DeleteEmptyJournals extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Delete empty and uneven transaction journals.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:delete-empty-journals';
/**

View File

@ -37,17 +37,8 @@ class DeleteOrphanedTransactions extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Deletes orphaned transactions.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:delete-orphaned-transactions';
/**

View File

@ -35,17 +35,8 @@ class DeleteZeroAmount extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Delete transactions with zero amount.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:delete-zero-amount';
/**

View File

@ -48,17 +48,9 @@ class ExportData extends Command
use ShowsFriendlyMessages;
use VerifiesAccessToken;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command to export data from Firefly III.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:export-data
{--user=1 : The user ID that the export should run for.}
{--token= : The user\'s access token.}

View File

@ -38,17 +38,9 @@ class ReportEmptyObjects extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Reports on empty database objects.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:report-empty-objects';
/**

View File

@ -36,17 +36,9 @@ class ReportIntegrity extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Will report on the integrity of your database.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:report-integrity';
/**

View File

@ -10,17 +10,9 @@ use Illuminate\Console\Command;
*/
class ReportSkeleton extends Command
{
/**
* The console command description.
*
* @var string
*/
protected $description = 'DESCRIPTION HERE';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:INT_COMMAND';
/**

View File

@ -36,17 +36,9 @@ class CreateDatabase extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Tries to create the database if it doesn\'t exist yet.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:create-database';
/**

View File

@ -39,17 +39,9 @@ class CreateFirstUser extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Creates a new user and gives admin rights. Outputs the password on the command line. Strictly for testing.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:create-first-user {email}';
private UserRepositoryInterface $repository;

View File

@ -40,17 +40,9 @@ class ForceMigration extends Command
use ShowsFriendlyMessages;
use VerifiesAccessToken;
/**
* The console command description.
*
* @var string
*/
protected $description = 'This command will force-run all database migrations.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:force-migrations
{--user=1 : The user ID.}
{--token= : The user\'s access token.}';

View File

@ -32,17 +32,9 @@ use Illuminate\Console\Command;
*/
class OutputVersion extends Command
{
/**
* The console command description.
*
* @var string
*/
protected $description = 'Outputs the Firefly III version';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:output-version';
/**

View File

@ -39,18 +39,10 @@ class ScanAttachments extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Rescan all attachments and re-set the correct MD5 hash and mime.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:scan-attachments';
/**

View File

@ -34,17 +34,9 @@ class SetLatestVersion extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Set latest version in DB.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:set-latest-version {--james-is-cool}';
/**

View File

@ -35,17 +35,9 @@ class UpgradeFireflyInstructions extends Command
{
use GeneratesInstallationId;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Instructions in case of upgrade trouble.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly:instructions {task}';
/**

View File

@ -39,17 +39,9 @@ class VerifySecurityAlerts extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Verify security alerts';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:verify-security-alerts';
/**

View File

@ -46,17 +46,9 @@ class ApplyRules extends Command
use ShowsFriendlyMessages;
use VerifiesAccessToken;
/**
* The console command description.
*
* @var string
*/
protected $description = 'This command will apply your rules and rule groups on a selection of your transactions.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature
= 'firefly-iii:apply-rules
{--user=1 : The user ID.}

View File

@ -45,17 +45,9 @@ class Cron extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Runs all Firefly III cron-job related commands. Configure a cron job according to the official Firefly III documentation.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:cron
{--F|force : Force the cron job(s) to execute.}
{--date= : Set the date in YYYY-MM-DD to make Firefly III think that\'s the current date.}

View File

@ -37,17 +37,9 @@ class AppendBudgetLimitPeriods extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '550_budget_limit_periods';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Append budget limits with their (estimated) timeframe.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:budget-limit-periods {--F|force : Force the execution of this command.}';
/**

View File

@ -42,17 +42,9 @@ class BackToJournals extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '480_back_to_journals';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Move meta data back to journals, not individual transactions.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:back-to-journals {--F|force : Force the execution of this command.}';
/**

View File

@ -38,17 +38,9 @@ class BudgetLimitCurrency extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '480_bl_currency';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Give budget limits a currency';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:bl-currency {--F|force : Force the execution of this command.}';
/**

View File

@ -35,17 +35,9 @@ class FixPostgresSequences extends Command
{
use ShowsFriendlyMessages;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Fixes issues with PostgreSQL sequences.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:fix-pgsql-sequences';
/**

View File

@ -39,17 +39,9 @@ class MigrateAttachments extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '480_migrate_attachments';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrates attachment meta-data.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:migrate-attachments {--F|force : Force the execution of this command.}';
/**

View File

@ -38,17 +38,9 @@ class MigrateJournalNotes extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '480_migrate_notes';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrate notes for transaction journals.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:migrate-notes {--F|force : Force the execution of this command.}';
/**

View File

@ -41,17 +41,9 @@ class MigrateRecurrenceMeta extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '481_migrate_recurrence_meta';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrate recurrence meta data';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:migrate-recurrence-meta {--F|force : Force the execution of this command.}';
/**

View File

@ -40,17 +40,9 @@ class MigrateRecurrenceType extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '550_migrate_recurrence_type';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrate transaction type of recurring transaction.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:migrate-recurrence-type {--F|force : Force the execution of this command.}';
/**

View File

@ -39,17 +39,9 @@ class MigrateTagLocations extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '500_migrate_tag_locations';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrate tag locations.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:migrate-tag-locations {--F|force : Force the execution of this command.}';
/**

View File

@ -45,17 +45,9 @@ class MigrateToRules extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '480_bills_to_rules';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrate bills to rules.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:bills-to-rules {--F|force : Force the execution of this command.}';
private BillRepositoryInterface $billRepository;
private int $count;

View File

@ -38,17 +38,9 @@ class RenameAccountMeta extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '480_rename_account_meta';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Rename account meta-data to new format.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:rename-account-meta {--F|force : Force the execution of this command.}';
/**

View File

@ -41,17 +41,9 @@ class UpgradeCurrencyPreferences extends Command
use ShowsFriendlyMessages;
public const CONFIG_NAME = '610_upgrade_currency_prefs';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Upgrade user currency preferences';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:upgrade-currency-preferences {--F|force : Force the execution of this command.}';
/**

View File

@ -12,17 +12,9 @@ class UpgradeSkeleton extends Command
{
use ShowsFriendlyMessages;
public const CONFIG_NAME = '480_some_name';
/**
* The console command description.
*
* @var string
*/
protected $description = 'SOME DESCRIPTION';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:UPGRSKELETON {--F|force : Force the execution of this command.}';
/**

View File

@ -36,7 +36,6 @@ final class IntervalException extends Exception
{
public array $availableIntervals;
public Periodicity $periodicity;
/** @var string */
protected $message = 'The periodicity %s is unknown. Choose one of available periodicity: %s';
public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null)

View File

@ -59,11 +59,6 @@ use PragmaRX\Google2FALaravel\Middleware as MFAMiddleware;
*/
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* @var array
*/
protected $middleware
= [
SecureHeaders::class,
@ -74,13 +69,6 @@ class Kernel extends HttpKernel
TrustProxies::class,
InstallationId::class,
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $middlewareAliases
= [
'auth' => Authenticate::class,
@ -90,11 +78,6 @@ class Kernel extends HttpKernel
'guest' => RedirectIfAuthenticated::class,
'throttle' => ThrottleRequests::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups
= [
// does not check login
@ -206,13 +189,6 @@ class Kernel extends HttpKernel
'bindings',
],
];
/**
* The priority-sorted list of middleware.
*
* This forces non-global middleware to always be in the given order.
*
* @var array
*/
protected $middlewarePriority
= [
StartFireflySession::class,

View File

@ -32,11 +32,6 @@ use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
*/
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array
*/
protected $except
= [
'password',

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';