From b302775c37ccb98fe31cd4ae8e4dd997b41a6358 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 31 Jul 2020 12:45:02 +0200 Subject: [PATCH] Various code cleanup. --- app/Events/AdminRequestedTestMessage.php | 1 + app/Events/RegisteredUser.php | 1 + app/Events/RequestedNewPassword.php | 1 + app/Events/RequestedReportOnJournals.php | 1 + app/Events/RequestedVersionCheckStatus.php | 1 + app/Events/StoredTransactionGroup.php | 1 + app/Events/UpdatedTransactionGroup.php | 2 +- app/Events/UserChangedEmail.php | 1 + app/Exceptions/Handler.php | 2 +- app/Factory/AccountFactory.php | 4 +--- app/Factory/AttachmentFactory.php | 1 + app/Factory/BillFactory.php | 1 + app/Factory/BudgetFactory.php | 3 +-- app/Factory/CategoryFactory.php | 1 + app/Factory/PiggyBankEventFactory.php | 1 - app/Factory/PiggyBankFactory.php | 2 +- app/Factory/RecurrenceFactory.php | 3 ++- app/Factory/TagFactory.php | 1 + app/Factory/TransactionCurrencyFactory.php | 1 - app/Factory/TransactionFactory.php | 1 + app/Factory/TransactionGroupFactory.php | 1 + app/Factory/TransactionJournalFactory.php | 3 ++- database/migrations/2020_07_24_162820_changes_for_v540.php | 2 +- 23 files changed, 23 insertions(+), 13 deletions(-) diff --git a/app/Events/AdminRequestedTestMessage.php b/app/Events/AdminRequestedTestMessage.php index 78f90858c8..87b3652aa2 100644 --- a/app/Events/AdminRequestedTestMessage.php +++ b/app/Events/AdminRequestedTestMessage.php @@ -42,6 +42,7 @@ class AdminRequestedTestMessage extends Event /** @var User The user */ public $user; + /** * Create a new event instance. * diff --git a/app/Events/RegisteredUser.php b/app/Events/RegisteredUser.php index a49d099f88..2518f8214e 100644 --- a/app/Events/RegisteredUser.php +++ b/app/Events/RegisteredUser.php @@ -41,6 +41,7 @@ class RegisteredUser extends Event /** @var User The user */ public $user; + /** * Create a new event instance. This event is triggered when a new user registers. * diff --git a/app/Events/RequestedNewPassword.php b/app/Events/RequestedNewPassword.php index 1706faa15c..2532ccc837 100644 --- a/app/Events/RequestedNewPassword.php +++ b/app/Events/RequestedNewPassword.php @@ -43,6 +43,7 @@ class RequestedNewPassword extends Event /** @var User The user */ public $user; + /** * Create a new event instance. This event is triggered when a users tries to reset his or her password. * diff --git a/app/Events/RequestedReportOnJournals.php b/app/Events/RequestedReportOnJournals.php index 0e29b88ea7..e16e0d205c 100644 --- a/app/Events/RequestedReportOnJournals.php +++ b/app/Events/RequestedReportOnJournals.php @@ -46,6 +46,7 @@ class RequestedReportOnJournals /** @var int The ID of the user. */ public $userId; + /** * Create a new event instance. * diff --git a/app/Events/RequestedVersionCheckStatus.php b/app/Events/RequestedVersionCheckStatus.php index 692f825d24..45f26a92c9 100644 --- a/app/Events/RequestedVersionCheckStatus.php +++ b/app/Events/RequestedVersionCheckStatus.php @@ -40,6 +40,7 @@ class RequestedVersionCheckStatus extends Event /** @var User The user */ public $user; + /** * Create a new event instance. This event is triggered when Firefly III wants to know * what the deal is with the version checker. diff --git a/app/Events/StoredTransactionGroup.php b/app/Events/StoredTransactionGroup.php index 13e9341eb3..391610e0ef 100644 --- a/app/Events/StoredTransactionGroup.php +++ b/app/Events/StoredTransactionGroup.php @@ -41,6 +41,7 @@ class StoredTransactionGroup extends Event /** @var TransactionGroup The group that was stored. */ public $transactionGroup; + /** * Create a new event instance. * diff --git a/app/Events/UpdatedTransactionGroup.php b/app/Events/UpdatedTransactionGroup.php index cd1ded0b2c..bd3f14e589 100644 --- a/app/Events/UpdatedTransactionGroup.php +++ b/app/Events/UpdatedTransactionGroup.php @@ -31,7 +31,6 @@ use Illuminate\Queue\SerializesModels; * Class UpdatedTransactionGroup. * * @codeCoverageIgnore - * */ class UpdatedTransactionGroup extends Event { @@ -42,6 +41,7 @@ class UpdatedTransactionGroup extends Event /** @var TransactionGroup The group that was stored. */ public $transactionGroup; + /** * Create a new event instance. * diff --git a/app/Events/UserChangedEmail.php b/app/Events/UserChangedEmail.php index 8f4f70090d..d293b4ed15 100644 --- a/app/Events/UserChangedEmail.php +++ b/app/Events/UserChangedEmail.php @@ -45,6 +45,7 @@ class UserChangedEmail extends Event /** @var User The user itself */ public $user; + /** * UserChangedEmail constructor. * diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index c5e4254c2f..d780e47191 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -31,10 +31,10 @@ use Exception; use FireflyIII\Jobs\MailError; use Illuminate\Auth\AuthenticationException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; +use Illuminate\Http\Request; use Illuminate\Validation\ValidationException as LaravelValidationException; use League\OAuth2\Server\Exception\OAuthServerException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Illuminate\Http\Request; use Throwable; /** * Class Handler diff --git a/app/Factory/AccountFactory.php b/app/Factory/AccountFactory.php index d7cf4e2665..45ea3b8a4e 100644 --- a/app/Factory/AccountFactory.php +++ b/app/Factory/AccountFactory.php @@ -113,7 +113,7 @@ class AccountFactory } // fix virtual balance when it's empty - if ('' === (string)$databaseData['virtual_balance']) { + if ('' === (string) $databaseData['virtual_balance']) { $databaseData['virtual_balance'] = null; } @@ -152,7 +152,6 @@ class AccountFactory } /** - * * @param string $accountName * @param string $accountType * @@ -198,7 +197,6 @@ class AccountFactory * @param null|string $accountType * * @return AccountType|null - * */ protected function getAccountType(?int $accountTypeId, ?string $accountType): ?AccountType { diff --git a/app/Factory/AttachmentFactory.php b/app/Factory/AttachmentFactory.php index 22c1d66e15..37c28d4ae1 100644 --- a/app/Factory/AttachmentFactory.php +++ b/app/Factory/AttachmentFactory.php @@ -39,6 +39,7 @@ class AttachmentFactory /** @var User */ private $user; + /** * Constructor. * diff --git a/app/Factory/BillFactory.php b/app/Factory/BillFactory.php index fadcf629b0..038b601911 100644 --- a/app/Factory/BillFactory.php +++ b/app/Factory/BillFactory.php @@ -43,6 +43,7 @@ class BillFactory /** @var User */ private $user; + /** * Constructor. * diff --git a/app/Factory/BudgetFactory.php b/app/Factory/BudgetFactory.php index ce6f9923d1..d28e677f6c 100644 --- a/app/Factory/BudgetFactory.php +++ b/app/Factory/BudgetFactory.php @@ -21,7 +21,6 @@ /** @noinspection MultipleReturnStatementsInspection */ declare(strict_types=1); - namespace FireflyIII\Factory; use FireflyIII\Models\Budget; @@ -36,6 +35,7 @@ class BudgetFactory /** @var User */ private $user; + /** * Constructor. * @@ -53,7 +53,6 @@ class BudgetFactory * @param null|string $budgetName * * @return Budget|null - * */ public function find(?int $budgetId, ?string $budgetName): ?Budget { diff --git a/app/Factory/CategoryFactory.php b/app/Factory/CategoryFactory.php index da55ff6cde..dac41a622c 100644 --- a/app/Factory/CategoryFactory.php +++ b/app/Factory/CategoryFactory.php @@ -38,6 +38,7 @@ class CategoryFactory /** @var User */ private $user; + /** * Constructor. * diff --git a/app/Factory/PiggyBankEventFactory.php b/app/Factory/PiggyBankEventFactory.php index 3eee4e3019..6f52157185 100644 --- a/app/Factory/PiggyBankEventFactory.php +++ b/app/Factory/PiggyBankEventFactory.php @@ -54,7 +54,6 @@ class PiggyBankEventFactory * @param PiggyBank|null $piggyBank * * @return PiggyBankEvent|null - * */ public function create(TransactionJournal $journal, ?PiggyBank $piggyBank): ?PiggyBankEvent { diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.php index 0a67e45240..3275582667 100644 --- a/app/Factory/PiggyBankFactory.php +++ b/app/Factory/PiggyBankFactory.php @@ -36,6 +36,7 @@ class PiggyBankFactory /** @var User */ private $user; + /** * Constructor. * @@ -53,7 +54,6 @@ class PiggyBankFactory * @param null|string $piggyBankName * * @return PiggyBank|null - * */ public function find(?int $piggyBankId, ?string $piggyBankName): ?PiggyBank { diff --git a/app/Factory/RecurrenceFactory.php b/app/Factory/RecurrenceFactory.php index c406845313..b3582200f3 100644 --- a/app/Factory/RecurrenceFactory.php +++ b/app/Factory/RecurrenceFactory.php @@ -39,12 +39,13 @@ use Log; */ class RecurrenceFactory { + + use TransactionTypeTrait, RecurringTransactionTrait; /** @var MessageBag */ private $errors; /** @var User */ private $user; - use TransactionTypeTrait, RecurringTransactionTrait; /** * Constructor. diff --git a/app/Factory/TagFactory.php b/app/Factory/TagFactory.php index 8e8cdaf409..a277211d92 100644 --- a/app/Factory/TagFactory.php +++ b/app/Factory/TagFactory.php @@ -40,6 +40,7 @@ class TagFactory /** @var User */ private $user; + /** * Constructor. * diff --git a/app/Factory/TransactionCurrencyFactory.php b/app/Factory/TransactionCurrencyFactory.php index bd6a74ef73..ab82ebffd3 100644 --- a/app/Factory/TransactionCurrencyFactory.php +++ b/app/Factory/TransactionCurrencyFactory.php @@ -82,7 +82,6 @@ class TransactionCurrencyFactory * @param null|string $currencyCode * * @return TransactionCurrency|null - * */ public function find(?int $currencyId, ?string $currencyCode): ?TransactionCurrency { diff --git a/app/Factory/TransactionFactory.php b/app/Factory/TransactionFactory.php index 4ede4f858d..9521838dc5 100644 --- a/app/Factory/TransactionFactory.php +++ b/app/Factory/TransactionFactory.php @@ -51,6 +51,7 @@ class TransactionFactory /** @var User */ private $user; + /** * Constructor. * diff --git a/app/Factory/TransactionGroupFactory.php b/app/Factory/TransactionGroupFactory.php index 34d5a2db8d..4363edad84 100644 --- a/app/Factory/TransactionGroupFactory.php +++ b/app/Factory/TransactionGroupFactory.php @@ -40,6 +40,7 @@ class TransactionGroupFactory /** @var User The user */ private $user; + /** * TransactionGroupFactory constructor. */ diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index 4670c770d2..42dc920e26 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -76,6 +76,7 @@ class TransactionJournalFactory /** @var User The user */ private $user; + /** * Constructor. * @@ -101,7 +102,7 @@ class TransactionJournalFactory 'import_hash', 'import_hash_v2', 'external_id', 'original_source', // recurring transactions - 'recurrence_total', 'recurrence_count' + 'recurrence_total', 'recurrence_count', ]; diff --git a/database/migrations/2020_07_24_162820_changes_for_v540.php b/database/migrations/2020_07_24_162820_changes_for_v540.php index 14e6133721..11f5224edd 100644 --- a/database/migrations/2020_07_24_162820_changes_for_v540.php +++ b/database/migrations/2020_07_24_162820_changes_for_v540.php @@ -19,7 +19,7 @@ class ChangesForV540 extends Migration { Schema::table( 'oauth_clients', static function (Blueprint $table) { - $table->dropColumn('order'); + $table->dropColumn('provider'); } );