From 0f6f4e1a50731c8ea109724935bc951db24fbab8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2023 19:00:25 +0100 Subject: [PATCH] Code cleanup and phpstan fixes. Still breaks but at least it's consistent. --- .ci/phpstan.neon | 18 ------ .../Autocomplete/AccountController.php | 4 +- .../Controllers/Summary/BasicController.php | 2 +- app/Models/Account.php | 6 +- app/Models/AccountMeta.php | 2 +- app/Models/Attachment.php | 6 +- app/Models/AuditLogEntry.php | 4 +- app/Models/AutoBudget.php | 8 +-- app/Models/AvailableBudget.php | 6 +- app/Models/Bill.php | 10 ++-- app/Models/Budget.php | 4 +- app/Models/BudgetLimit.php | 4 +- app/Models/Category.php | 2 +- app/Models/CurrencyExchangeRate.php | 8 +-- app/Models/GroupMembership.php | 8 +-- app/Models/InvitedUser.php | 2 +- app/Models/Location.php | 2 +- app/Models/Note.php | 2 +- app/Models/ObjectGroup.php | 2 +- app/Models/PiggyBank.php | 6 +- app/Models/PiggyBankEvent.php | 2 +- app/Models/PiggyBankRepetition.php | 4 +- app/Models/Preference.php | 2 +- app/Models/Recurrence.php | 4 +- app/Models/RecurrenceMeta.php | 2 +- app/Models/RecurrenceRepetition.php | 2 +- app/Models/RecurrenceTransaction.php | 12 ++-- app/Models/RecurrenceTransactionMeta.php | 2 +- app/Models/Rule.php | 6 +- app/Models/RuleAction.php | 2 +- app/Models/RuleGroup.php | 2 +- app/Models/RuleTrigger.php | 6 +- app/Models/Tag.php | 2 +- app/Models/Transaction.php | 4 +- app/Models/TransactionCurrency.php | 2 +- app/Models/TransactionGroup.php | 2 +- app/Models/TransactionJournal.php | 4 +- app/Models/TransactionJournalLink.php | 2 +- app/Models/Webhook.php | 2 +- app/Models/WebhookAttempt.php | 2 +- app/Models/WebhookMessage.php | 2 +- app/User.php | 2 +- composer.json | 1 - composer.lock | 57 +------------------ 44 files changed, 80 insertions(+), 154 deletions(-) diff --git a/.ci/phpstan.neon b/.ci/phpstan.neon index 6883101544..d46e730cf9 100644 --- a/.ci/phpstan.neon +++ b/.ci/phpstan.neon @@ -1,21 +1,3 @@ -includes: - - ../vendor/symplify/phpstan-rules/config/code-complexity-rules.neon - - ../vendor/symplify/phpstan-rules/config/collector-rules.neon - - ../vendor/symplify/phpstan-rules/config/naming-rules.neon - - ../vendor/symplify/phpstan-rules/config/regex-rules.neon - - ../vendor/symplify/phpstan-rules/config/static-rules.neon - - ../vendor/symplify/phpstan-rules/config/configurable-rules.neon - -services: - - - class: Symplify\PHPStanRules\Rules\ForbiddenNodeRule - tags: [phpstan.rules.rule] - arguments: - forbiddenNodes: - - PhpParser\Node\Expr\Empty_ - - PhpParser\Node\Expr\ErrorSuppress - - parameters: universalObjectCratesClasses: - Illuminate\Database\Eloquent\Model diff --git a/app/Api/V2/Controllers/Autocomplete/AccountController.php b/app/Api/V2/Controllers/Autocomplete/AccountController.php index bb048cd766..fb99a57861 100644 --- a/app/Api/V2/Controllers/Autocomplete/AccountController.php +++ b/app/Api/V2/Controllers/Autocomplete/AccountController.php @@ -90,8 +90,8 @@ class AccountController extends Controller $date = $this->parameters->get('date') ?? today(config('app.timezone')); $result = $this->adminRepository->searchAccount((string)$query, $types, $data['limit']); $defaultCurrency = app('amount')->getDefaultCurrency(); - - $allItems = []; + $groupedResult = []; + $allItems = []; /** @var Account $account */ foreach ($result as $account) { $nameWithBalance = $account->name; diff --git a/app/Api/V2/Controllers/Summary/BasicController.php b/app/Api/V2/Controllers/Summary/BasicController.php index bc88c3dd50..ef0dd72b43 100644 --- a/app/Api/V2/Controllers/Summary/BasicController.php +++ b/app/Api/V2/Controllers/Summary/BasicController.php @@ -393,7 +393,7 @@ class BasicController extends Controller */ foreach ($spent as $currencyId => $row) { app('log')->debug(sprintf('Processing spent array in currency #%d', $currencyId)); - $currencyId = (int)$currencyId; + $currencyId = $currencyId; $spent = '0'; $spentNative = '0'; // get the sum from the array of transactions (double loop but who cares) diff --git a/app/Models/Account.php b/app/Models/Account.php index 5debc3e103..b9fdde9f25 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -46,14 +46,14 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id - * @property int $account_type_id + * @property int|string $user_id + * @property int|string $account_type_id * @property string $name * @property string|null $virtual_balance * @property string|null $iban * @property bool $active * @property bool $encrypted - * @property int $order + * @property int|string $order * @property-read Collection|AccountMeta[] $accountMeta * @property-read int|null $account_meta_count * @property AccountType $accountType diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index e7eec41173..2963525301 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -35,7 +35,7 @@ use Carbon\Carbon; * @property int|string $id * @property Carbon|null $created_at * @property Carbon|null $updated_at - * @property int $account_id + * @property int|string $account_id * @property string $name * @property mixed $data * @property-read Account $account diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index 95f3d1accb..10af718151 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -42,8 +42,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id - * @property int $attachable_id + * @property int|string $user_id + * @property int|string $attachable_id * @property string $attachable_type * @property bool $file_exists * @property string $md5 @@ -51,7 +51,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property string|null $title * @property string|null $description * @property string $mime - * @property int $size + * @property int|string $size * @property bool $uploaded * @property string $notes_text * @property-read Model|Eloquent $attachable diff --git a/app/Models/AuditLogEntry.php b/app/Models/AuditLogEntry.php index 2afe083ae3..b1945de8eb 100644 --- a/app/Models/AuditLogEntry.php +++ b/app/Models/AuditLogEntry.php @@ -46,9 +46,9 @@ use Carbon\Carbon; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $auditable_id + * @property int|string $auditable_id * @property string $auditable_type - * @property int $changer_id + * @property int|string $changer_id * @property string $changer_type * @property string $action * @property array|null $before diff --git a/app/Models/AutoBudget.php b/app/Models/AutoBudget.php index f289b731a2..e826f7cfe7 100644 --- a/app/Models/AutoBudget.php +++ b/app/Models/AutoBudget.php @@ -39,10 +39,10 @@ use Carbon\Carbon; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $budget_id - * @property int $transaction_currency_id - * @property int $auto_budget_type - * @property string $amount + * @property int|string $budget_id + * @property int|string $transaction_currency_id + * @property int|string $auto_budget_type + * @property string|float $amount * @property string $period * @property-read Budget $budget * @property-read TransactionCurrency $transactionCurrency diff --git a/app/Models/AvailableBudget.php b/app/Models/AvailableBudget.php index 91a09a5cda..9f1782ba67 100644 --- a/app/Models/AvailableBudget.php +++ b/app/Models/AvailableBudget.php @@ -40,9 +40,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id - * @property int $transaction_currency_id - * @property string $amount + * @property int|string $user_id + * @property int|string $transaction_currency_id + * @property string|float $amount * @property Carbon $start_date * @property Carbon $end_date * @property-read TransactionCurrency $transactionCurrency diff --git a/app/Models/Bill.php b/app/Models/Bill.php index fe826d828e..25b1823a83 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -45,22 +45,22 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id + * @property int|string $user_id * @property int|null $transaction_currency_id * @property string $name * @property string $match - * @property string $amount_min - * @property string $amount_max + * @property string|float $amount_min + * @property string|float $amount_max * @property Carbon $date * @property Carbon|null $end_date * @property Carbon|null $extension_date * @property string $repeat_freq - * @property int $skip + * @property int|string $skip * @property bool $automatch * @property bool $active * @property bool $name_encrypted * @property bool $match_encrypted - * @property int $order + * @property int|string $order * @property-read Collection|Attachment[] $attachments * @property-read int|null $attachments_count * @property-read Collection|Note[] $notes diff --git a/app/Models/Budget.php b/app/Models/Budget.php index e3ba8af2a1..a17258f26d 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -43,11 +43,11 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id + * @property int|string $user_id * @property string $name * @property bool $active * @property bool $encrypted - * @property int $order + * @property int|string $order * @property-read Collection|Attachment[] $attachments * @property-read int|null $attachments_count * @property-read Collection|AutoBudget[] $autoBudgets diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index 880d09b7c5..92651f1008 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -44,10 +44,10 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property int|null $transaction_currency_id * @property Carbon $start_date * @property Carbon|null $end_date - * @property string $amount + * @property string|float $amount * @property string $spent * @property string|null $period - * @property int $generated + * @property int|string $generated * @property-read Budget $budget * @property-read TransactionCurrency|null $transactionCurrency * @method static Builder|BudgetLimit newModelQuery() diff --git a/app/Models/Category.php b/app/Models/Category.php index 3b228e650d..7db3123314 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -42,7 +42,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id + * @property int|string $user_id * @property string $name * @property Carbon $lastActivity * @property bool $encrypted diff --git a/app/Models/CurrencyExchangeRate.php b/app/Models/CurrencyExchangeRate.php index 7605fbbb5e..cdb4e062b7 100644 --- a/app/Models/CurrencyExchangeRate.php +++ b/app/Models/CurrencyExchangeRate.php @@ -39,11 +39,11 @@ use Carbon\Carbon; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property string|null $deleted_at - * @property int $user_id - * @property int $from_currency_id - * @property int $to_currency_id + * @property int|string $user_id + * @property int|string $from_currency_id + * @property int|string $to_currency_id * @property Carbon $date - * @property string $rate + * @property string|float $rate * @property string|null $user_rate * @property-read TransactionCurrency $fromCurrency * @property-read TransactionCurrency $toCurrency diff --git a/app/Models/GroupMembership.php b/app/Models/GroupMembership.php index 1ca2128374..b9011228ef 100644 --- a/app/Models/GroupMembership.php +++ b/app/Models/GroupMembership.php @@ -34,13 +34,13 @@ use Carbon\Carbon; /** * Class GroupMembership * - * @property int $id + * @property int|string $id * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property string|null $deleted_at - * @property int $user_id - * @property int $user_group_id - * @property int $user_role_id + * @property int|string $user_id + * @property int|string $user_group_id + * @property int|string $user_role_id * @property-read User $user * @property-read UserGroup $userGroup * @property-read UserRole $userRole diff --git a/app/Models/InvitedUser.php b/app/Models/InvitedUser.php index 5e3714ca78..3825ec140a 100644 --- a/app/Models/InvitedUser.php +++ b/app/Models/InvitedUser.php @@ -42,7 +42,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property int|string $id * @property Carbon|null $created_at * @property Carbon|null $updated_at - * @property int $user_id + * @property int|string $user_id * @property string $email * @property string $invite_code * @property Carbon $expires diff --git a/app/Models/Location.php b/app/Models/Location.php index d561230521..ad521c6d30 100644 --- a/app/Models/Location.php +++ b/app/Models/Location.php @@ -39,7 +39,7 @@ use Carbon\Carbon; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $locatable_id + * @property int|string $locatable_id * @property string $locatable_type * @property float|null $latitude * @property float|null $longitude diff --git a/app/Models/Note.php b/app/Models/Note.php index 44d4d9d074..33c3f03b69 100644 --- a/app/Models/Note.php +++ b/app/Models/Note.php @@ -37,7 +37,7 @@ use Carbon\Carbon; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $noteable_id + * @property int|string $noteable_id * @property string $noteable_type * @property string|null $title * @property string|null $text diff --git a/app/Models/ObjectGroup.php b/app/Models/ObjectGroup.php index 3f3ec9cf2c..80e922e4dd 100644 --- a/app/Models/ObjectGroup.php +++ b/app/Models/ObjectGroup.php @@ -43,7 +43,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $updated_at * @property Carbon|null $deleted_at * @property string $title - * @property int $order + * @property int|string $order * @property-read Collection|Account[] $accounts * @property-read int|null $accounts_count * @property-read Collection|Bill[] $bills diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php index 2f10dd7e4f..406e437249 100644 --- a/app/Models/PiggyBank.php +++ b/app/Models/PiggyBank.php @@ -43,12 +43,12 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $account_id + * @property int|string $account_id * @property string $name - * @property string $targetamount + * @property string|float $targetamount * @property Carbon|null $startdate * @property Carbon|null $targetdate - * @property int $order + * @property int|string $order * @property bool $active * @property bool $encrypted * @property-read Account $account diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php index 08a235cd62..96b1254e9b 100644 --- a/app/Models/PiggyBankEvent.php +++ b/app/Models/PiggyBankEvent.php @@ -36,7 +36,7 @@ use Carbon\Carbon; * @property int|string $id * @property Carbon|null $created_at * @property Carbon|null $updated_at - * @property int $piggy_bank_id + * @property int|string $piggy_bank_id * @property int|null $transaction_journal_id * @property Carbon $date * @property string $amount diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index 13d2529753..eec33efd2b 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -36,10 +36,10 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * @property int|string $id * @property Carbon|null $created_at * @property Carbon|null $updated_at - * @property int $piggy_bank_id + * @property int|string $piggy_bank_id * @property Carbon|null $startdate * @property Carbon|null $targetdate - * @property string $currentamount + * @property string|float $currentamount * @property-read PiggyBank $piggyBank * @method static EloquentBuilder|PiggyBankRepetition newModelQuery() * @method static EloquentBuilder|PiggyBankRepetition newQuery() diff --git a/app/Models/Preference.php b/app/Models/Preference.php index 7c518f1655..1da02183b5 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -37,7 +37,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property int|string $id * @property Carbon|null $created_at * @property Carbon|null $updated_at - * @property int $user_id + * @property int|string $user_id * @property string $name * @property int|string|array|null $data * @property-read User $user diff --git a/app/Models/Recurrence.php b/app/Models/Recurrence.php index 1492a22831..d63c762438 100644 --- a/app/Models/Recurrence.php +++ b/app/Models/Recurrence.php @@ -42,8 +42,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id - * @property int $transaction_type_id + * @property int|string $user_id + * @property int|string $transaction_type_id * @property string $title * @property string $description * @property Carbon|null $first_date diff --git a/app/Models/RecurrenceMeta.php b/app/Models/RecurrenceMeta.php index e5f5a7e886..649c492410 100644 --- a/app/Models/RecurrenceMeta.php +++ b/app/Models/RecurrenceMeta.php @@ -37,7 +37,7 @@ use Carbon\Carbon; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $recurrence_id + * @property int|string $recurrence_id * @property string $name * @property mixed $value * @property-read Recurrence $recurrence diff --git a/app/Models/RecurrenceRepetition.php b/app/Models/RecurrenceRepetition.php index f6a9070011..5663a69b26 100644 --- a/app/Models/RecurrenceRepetition.php +++ b/app/Models/RecurrenceRepetition.php @@ -37,7 +37,7 @@ use Carbon\Carbon; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $recurrence_id + * @property int|string $recurrence_id * @property string $repetition_type * @property string $repetition_moment * @property int $repetition_skip diff --git a/app/Models/RecurrenceTransaction.php b/app/Models/RecurrenceTransaction.php index afc89187a3..3280e49a54 100644 --- a/app/Models/RecurrenceTransaction.php +++ b/app/Models/RecurrenceTransaction.php @@ -40,13 +40,13 @@ use Carbon\Carbon; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $recurrence_id - * @property int $transaction_currency_id + * @property int|string $recurrence_id + * @property int|string $transaction_currency_id * @property int|null $foreign_currency_id - * @property int $source_id - * @property int $destination_id - * @property string $amount - * @property string|null $foreign_amount + * @property int|string $source_id + * @property int|string $destination_id + * @property string|float $amount + * @property string|float|null $foreign_amount * @property string $description * @property-read Account $destinationAccount * @property-read TransactionCurrency|null $foreignCurrency diff --git a/app/Models/RecurrenceTransactionMeta.php b/app/Models/RecurrenceTransactionMeta.php index 9ea7ccaf18..7a753d689c 100644 --- a/app/Models/RecurrenceTransactionMeta.php +++ b/app/Models/RecurrenceTransactionMeta.php @@ -37,7 +37,7 @@ use Carbon\Carbon; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $rt_id + * @property int|string $rt_id * @property string $name * @property mixed $value * @property-read RecurrenceTransaction $recurrenceTransaction diff --git a/app/Models/Rule.php b/app/Models/Rule.php index fd489395bf..f30d8274c2 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -41,11 +41,11 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id - * @property int $rule_group_id + * @property int|string $user_id + * @property int|string $rule_group_id * @property string $title * @property string|null $description - * @property int $order + * @property int|string $order * @property bool $active * @property bool $stop_processing * @property bool $strict diff --git a/app/Models/RuleAction.php b/app/Models/RuleAction.php index 67a2e8f127..b3b40a646a 100644 --- a/app/Models/RuleAction.php +++ b/app/Models/RuleAction.php @@ -35,7 +35,7 @@ use Carbon\Carbon; * @property int|string $id * @property Carbon|null $created_at * @property Carbon|null $updated_at - * @property int $rule_id + * @property int|string $rule_id * @property string $action_type * @property string $action_value * @property int $order diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index d5a0bce4c3..4ceebae0ca 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -41,7 +41,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id + * @property int|string $user_id * @property string $title * @property string|null $description * @property int $order diff --git a/app/Models/RuleTrigger.php b/app/Models/RuleTrigger.php index 989208c8d3..31975de3fd 100644 --- a/app/Models/RuleTrigger.php +++ b/app/Models/RuleTrigger.php @@ -35,9 +35,9 @@ use Carbon\Carbon; * @property int|string $id * @property Carbon|null $created_at * @property Carbon|null $updated_at - * @property int $rule_id - * @property string $trigger_type - * @property string $trigger_value + * @property int|string $rule_id + * @property string|null $trigger_type + * @property string|null $trigger_value * @property int $order * @property bool $active * @property bool $stop_processing diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 3ac70a0b23..80658b8f95 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -42,7 +42,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id + * @property int|string $user_id * @property string $tag * @property string $tagMode * @property Carbon|null $date diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index d41ab7b2d5..64aeffc6e0 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -42,8 +42,8 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property Carbon|null $updated_at * @property Carbon|null $deleted_at * @property bool $reconciled - * @property int $account_id - * @property int $transaction_journal_id + * @property int|string $account_id + * @property int|string $transaction_journal_id * @property string|null $description * @property int|null $transaction_currency_id * @property string $modified diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php index a0a3ea3a5f..2379dcdf76 100644 --- a/app/Models/TransactionCurrency.php +++ b/app/Models/TransactionCurrency.php @@ -47,7 +47,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property string $code * @property string $name * @property string $symbol - * @property int $decimal_places + * @property int|string $decimal_places * @property-read Collection|BudgetLimit[] $budgetLimits * @property-read int|null $budget_limits_count * @property-read Collection|TransactionJournal[] $transactionJournals diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php index 2b91ccbb9c..606c28855e 100644 --- a/app/Models/TransactionGroup.php +++ b/app/Models/TransactionGroup.php @@ -41,7 +41,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id + * @property int|string $user_id * @property string|null $title * @property-read Collection|TransactionJournal[] $transactionJournals * @property-read int|null $transaction_journals_count diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index ef5b934adc..e199c39ea4 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -45,8 +45,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id - * @property int $transaction_type_id + * @property int|string $user_id + * @property int |string $transaction_type_id * @property int|null $transaction_group_id * @property int|null $bill_id * @property int|null $transaction_currency_id diff --git a/app/Models/TransactionJournalLink.php b/app/Models/TransactionJournalLink.php index 4efedcf53e..fc7bcb5eae 100644 --- a/app/Models/TransactionJournalLink.php +++ b/app/Models/TransactionJournalLink.php @@ -38,7 +38,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property int|string $id * @property Carbon|null $created_at * @property Carbon|null $updated_at - * @property int $link_type_id + * @property |stringint $link_type_id * @property int $source_id * @property int $destination_id * @property string|null $comment diff --git a/app/Models/Webhook.php b/app/Models/Webhook.php index 6e91a37574..f7817b5c13 100644 --- a/app/Models/Webhook.php +++ b/app/Models/Webhook.php @@ -44,7 +44,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property Carbon|null $deleted_at - * @property int $user_id + * @property int|string $user_id * @property bool $active * @property int $trigger * @property int $response diff --git a/app/Models/WebhookAttempt.php b/app/Models/WebhookAttempt.php index 019e7e928c..8ebef89a64 100644 --- a/app/Models/WebhookAttempt.php +++ b/app/Models/WebhookAttempt.php @@ -39,7 +39,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property string|null $deleted_at - * @property int $webhook_message_id + * @property int|string $webhook_message_id * @property int $status_code * @property string|null $logs * @property string|null $response diff --git a/app/Models/WebhookMessage.php b/app/Models/WebhookMessage.php index 38237b0ff4..c2c18ed12b 100644 --- a/app/Models/WebhookMessage.php +++ b/app/Models/WebhookMessage.php @@ -41,7 +41,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property string|null $deleted_at - * @property int $webhook_id + * @property int|string $webhook_id * @property bool $sent * @property bool $errored * @property int $attempts diff --git a/app/User.php b/app/User.php index e10efc3c5a..ec540f7efa 100644 --- a/app/User.php +++ b/app/User.php @@ -80,7 +80,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** * Class User. * - * @property int $id + * @property int|string $id * @property string $email * @property bool $isAdmin * @property bool $has2FA diff --git a/composer.json b/composer.json index 6ab3bb9bc6..3e73174eae 100644 --- a/composer.json +++ b/composer.json @@ -121,7 +121,6 @@ "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-strict-rules": "^1.4", "phpunit/phpunit": "^10", - "symplify/phpstan-rules": "^12.4", "thecodingmachine/phpstan-strict-rules": "^1.0" }, "suggest": { diff --git a/composer.lock b/composer.lock index 7d101092c2..98dd770117 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "68c12b4cd64c80ddda151a22622e822d", + "content-hash": "40e0d0acc39fde17b9e90f10ff4b7b8c", "packages": [ { "name": "bacon/bacon-qr-code", @@ -11604,61 +11604,6 @@ ], "time": "2023-02-07T11:34:05+00:00" }, - { - "name": "symplify/phpstan-rules", - "version": "12.4.3", - "source": { - "type": "git", - "url": "https://github.com/symplify/phpstan-rules.git", - "reference": "54def05dea85612c8c7729933ba5457dbd3eed64" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symplify/phpstan-rules/zipball/54def05dea85612c8c7729933ba5457dbd3eed64", - "reference": "54def05dea85612c8c7729933ba5457dbd3eed64", - "shasum": "" - }, - "require": { - "nette/utils": "^3.2 || ^4.0", - "nikic/php-parser": "^4.17.1", - "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.30", - "webmozart/assert": "^1.11" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "config/services/services.neon" - ] - } - }, - "autoload": { - "psr-4": { - "Symplify\\PHPStanRules\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Set of Symplify rules for PHPStan", - "support": { - "issues": "https://github.com/symplify/phpstan-rules/issues", - "source": "https://github.com/symplify/phpstan-rules/tree/12.4.3" - }, - "funding": [ - { - "url": "https://www.paypal.me/rectorphp", - "type": "custom" - }, - { - "url": "https://github.com/tomasvotruba", - "type": "github" - } - ], - "time": "2023-10-19T08:45:51+00:00" - }, { "name": "thecodingmachine/phpstan-strict-rules", "version": "v1.0.0",