Skip to content

Firefly III: a personal finances manager

More code cleanup

James Cole4961b1f715de
diff --git a/.ci/php-cs-fixer/.php-cs-fixer.php b/.ci/php-cs-fixer/.php-cs-fixer.php
index 9a400c4ef9..c37cc105e1 100644
--- a/.ci/php-cs-fixer/.php-cs-fixer.php
+++ b/.ci/php-cs-fixer/.php-cs-fixer.php
@@ -24,7 +24,7 @@ $current = __DIR__;
$paths = [
$current . '/../../app',
$current . '/../../config',
-// $current . '/../../database',
+ $current . '/../../database',
// $current . '/../../routes',
// $current . '/../../tests',
// $current . '/../../resources/lang',
diff --git a/database/migrations/2016_06_16_000000_create_support_tables.php b/database/migrations/2016_06_16_000000_create_support_tables.php
index 37faf813de..a063f16276 100644
--- a/database/migrations/2016_06_16_000000_create_support_tables.php
+++ b/database/migrations/2016_06_16_000000_create_support_tables.php
@@ -54,6 +54,7 @@ class CreateSupportTables extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
@@ -70,9 +71,6 @@ class CreateSupportTables extends Migration
$this->createConfigurationTable();
}
- /**
- * @return void
- */
private function createAccountTypeTable(): void
{
if (!Schema::hasTable('account_types')) {
@@ -95,9 +93,6 @@ class CreateSupportTables extends Migration
}
}
- /**
- * @return void
- */
private function createCurrencyTable(): void
{
if (!Schema::hasTable('transaction_currencies')) {
@@ -123,9 +118,6 @@ class CreateSupportTables extends Migration
}
}
- /**
- * @return void
- */
private function createTransactionTypeTable(): void
{
if (!Schema::hasTable('transaction_types')) {
@@ -149,9 +141,6 @@ class CreateSupportTables extends Migration
}
}
- /**
- * @return void
- */
private function createJobsTable(): void
{
if (!Schema::hasTable('jobs')) {
@@ -178,9 +167,6 @@ class CreateSupportTables extends Migration
}
}
- /**
- * @return void
- */
private function createPasswordTable(): void
{
if (!Schema::hasTable('password_resets')) {
@@ -201,9 +187,6 @@ class CreateSupportTables extends Migration
}
}
- /**
- * @return void
- */
private function createPermissionsTable(): void
{
if (!Schema::hasTable('permissions')) {
@@ -225,9 +208,6 @@ class CreateSupportTables extends Migration
}
}
- /**
- * @return void
- */
private function createRolesTable(): void
{
if (!Schema::hasTable('roles')) {
@@ -249,9 +229,6 @@ class CreateSupportTables extends Migration
}
}
- /**
- * @return void
- */
private function createPermissionRoleTable(): void
{
if (!Schema::hasTable('permission_role')) {
@@ -275,9 +252,6 @@ class CreateSupportTables extends Migration
}
}
- /**
- * @return void
- */
private function createSessionsTable(): void
{
if (!Schema::hasTable('sessions')) {
@@ -300,9 +274,6 @@ class CreateSupportTables extends Migration
}
}
- /**
- * @return void
- */
private function createConfigurationTable(): void
{
if (!Schema::hasTable('configuration')) {
diff --git a/database/migrations/2016_06_16_000001_create_users_table.php b/database/migrations/2016_06_16_000001_create_users_table.php
index 2b7f8c9682..7d3d372efa 100644
--- a/database/migrations/2016_06_16_000001_create_users_table.php
+++ b/database/migrations/2016_06_16_000001_create_users_table.php
@@ -45,8 +45,8 @@ class CreateUsersTable extends Migration
/**
* Run the migrations.
- * @SuppressWarnings(PHPMD.ShortMethodName)
*
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
diff --git a/database/migrations/2016_06_16_000002_create_main_tables.php b/database/migrations/2016_06_16_000002_create_main_tables.php
index 6c85d671c0..1a94293c6a 100644
--- a/database/migrations/2016_06_16_000002_create_main_tables.php
+++ b/database/migrations/2016_06_16_000002_create_main_tables.php
@@ -72,8 +72,8 @@ class CreateMainTables extends Migration
/**
* Run the migrations.
- * @SuppressWarnings(PHPMD.ShortMethodName)
*
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
@@ -252,8 +252,6 @@ class CreateMainTables extends Migration
}
}
- /**
- */
private function createBudgetTables(): void
{
if (!Schema::hasTable('budgets')) {
@@ -317,9 +315,6 @@ class CreateMainTables extends Migration
}
}
- /**
- * @return void
- */
private function createCategoriesTable(): void
{
if (!Schema::hasTable('categories')) {
@@ -368,9 +363,6 @@ class CreateMainTables extends Migration
}
}
- /**
- * @return void
- */
private function createRoleTable(): void
{
if (!Schema::hasTable('role_user')) {
@@ -499,9 +491,6 @@ class CreateMainTables extends Migration
}
}
- /**
- * @return void
- */
private function createTagsTable(): void
{
if (!Schema::hasTable('tags')) {
@@ -533,9 +522,6 @@ class CreateMainTables extends Migration
}
}
- /**
- * @return void
- */
private function createTransactionTables(): void
{
if (!Schema::hasTable('transaction_journals')) {
diff --git a/database/migrations/2016_08_25_091522_changes_for_3101.php b/database/migrations/2016_08_25_091522_changes_for_3101.php
index f1aa6f3e42..2743c4fad5 100644
--- a/database/migrations/2016_08_25_091522_changes_for_3101.php
+++ b/database/migrations/2016_08_25_091522_changes_for_3101.php
@@ -37,8 +37,8 @@ class ChangesFor3101 extends Migration
/**
* Run the migrations.
- * @SuppressWarnings(PHPMD.ShortMethodName)
*
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void {}
}
diff --git a/database/migrations/2016_09_12_121359_fix_nullables.php b/database/migrations/2016_09_12_121359_fix_nullables.php
index 0394d5b810..90277e8c08 100644
--- a/database/migrations/2016_09_12_121359_fix_nullables.php
+++ b/database/migrations/2016_09_12_121359_fix_nullables.php
@@ -42,8 +42,8 @@ class FixNullables extends Migration
/**
* Run the migrations.
- * @SuppressWarnings(PHPMD.ShortMethodName)
*
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
diff --git a/database/migrations/2016_10_09_150037_expand_transactions_table.php b/database/migrations/2016_10_09_150037_expand_transactions_table.php
index d89351ab75..fa5dc6bb8f 100644
--- a/database/migrations/2016_10_09_150037_expand_transactions_table.php
+++ b/database/migrations/2016_10_09_150037_expand_transactions_table.php
@@ -46,7 +46,7 @@ class ExpandTransactionsTable extends Migration
$table->dropColumn('identifier');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not drop column "identifier": %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -55,8 +55,8 @@ class ExpandTransactionsTable extends Migration
/**
* Run the migrations.
- * @SuppressWarnings(PHPMD.ShortMethodName)
*
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
diff --git a/database/migrations/2016_10_22_075804_changes_for_v410.php b/database/migrations/2016_10_22_075804_changes_for_v410.php
index 54f9d108e2..cb722eae7f 100644
--- a/database/migrations/2016_10_22_075804_changes_for_v410.php
+++ b/database/migrations/2016_10_22_075804_changes_for_v410.php
@@ -42,6 +42,7 @@ class ChangesForV410 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2016_11_24_210552_changes_for_v420.php b/database/migrations/2016_11_24_210552_changes_for_v420.php
index a2e9afe412..f66cce7988 100644
--- a/database/migrations/2016_11_24_210552_changes_for_v420.php
+++ b/database/migrations/2016_11_24_210552_changes_for_v420.php
@@ -54,8 +54,8 @@ class ChangesForV420 extends Migration
/**
* Run the migrations.
- * @SuppressWarnings(PHPMD.ShortMethodName)
*
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
diff --git a/database/migrations/2016_12_22_150431_changes_for_v430.php b/database/migrations/2016_12_22_150431_changes_for_v430.php
index b265485128..39538f84b7 100644
--- a/database/migrations/2016_12_22_150431_changes_for_v430.php
+++ b/database/migrations/2016_12_22_150431_changes_for_v430.php
@@ -42,6 +42,7 @@ class ChangesForV430 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2016_12_28_203205_changes_for_v431.php b/database/migrations/2016_12_28_203205_changes_for_v431.php
index c177e7317e..e33c166654 100644
--- a/database/migrations/2016_12_28_203205_changes_for_v431.php
+++ b/database/migrations/2016_12_28_203205_changes_for_v431.php
@@ -74,7 +74,7 @@ class ChangesForV431 extends Migration
$table->renameColumn('start_date', 'startdate');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -89,7 +89,7 @@ class ChangesForV431 extends Migration
$table->dropColumn('end_date');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -103,7 +103,7 @@ class ChangesForV431 extends Migration
$table->dropColumn('decimal_places');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -112,6 +112,7 @@ class ChangesForV431 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
@@ -140,7 +141,7 @@ class ChangesForV431 extends Migration
$table->renameColumn('startdate', 'start_date');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -170,7 +171,7 @@ class ChangesForV431 extends Migration
$table->dropColumn('repeats');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -183,7 +184,7 @@ class ChangesForV431 extends Migration
$table->dropColumn('repeat_freq');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
diff --git a/database/migrations/2017_04_13_163623_changes_for_v440.php b/database/migrations/2017_04_13_163623_changes_for_v440.php
index 5252a8042a..39970e7b17 100644
--- a/database/migrations/2017_04_13_163623_changes_for_v440.php
+++ b/database/migrations/2017_04_13_163623_changes_for_v440.php
@@ -39,6 +39,7 @@ class ChangesForV440 extends Migration
public function down(): void
{
Schema::dropIfExists('currency_exchange_rates');
+
try {
Schema::table(
'transactions',
@@ -52,7 +53,7 @@ class ChangesForV440 extends Migration
}
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -60,6 +61,7 @@ class ChangesForV440 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2017_06_02_105232_changes_for_v450.php b/database/migrations/2017_06_02_105232_changes_for_v450.php
index e0db079ec9..8fbb89c9a1 100644
--- a/database/migrations/2017_06_02_105232_changes_for_v450.php
+++ b/database/migrations/2017_06_02_105232_changes_for_v450.php
@@ -47,7 +47,7 @@ class ChangesForV450 extends Migration
$table->dropColumn('foreign_amount');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -75,7 +75,7 @@ class ChangesForV450 extends Migration
$table->dropColumn('foreign_currency_id');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -84,6 +84,7 @@ class ChangesForV450 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2017_08_20_062014_changes_for_v470.php b/database/migrations/2017_08_20_062014_changes_for_v470.php
index 4ab5e7d0c1..3ac4a9d78f 100644
--- a/database/migrations/2017_08_20_062014_changes_for_v470.php
+++ b/database/migrations/2017_08_20_062014_changes_for_v470.php
@@ -44,6 +44,7 @@ class ChangesForV470 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2017_11_04_170844_changes_for_v470a.php b/database/migrations/2017_11_04_170844_changes_for_v470a.php
index e9ffe8c980..b174b72aad 100644
--- a/database/migrations/2017_11_04_170844_changes_for_v470a.php
+++ b/database/migrations/2017_11_04_170844_changes_for_v470a.php
@@ -47,7 +47,7 @@ class ChangesForV470a extends Migration
$table->dropColumn('reconciled');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -56,6 +56,7 @@ class ChangesForV470a extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2018_01_01_000001_create_oauth_auth_codes_table.php b/database/migrations/2018_01_01_000001_create_oauth_auth_codes_table.php
index e04833531e..1f77365235 100644
--- a/database/migrations/2018_01_01_000001_create_oauth_auth_codes_table.php
+++ b/database/migrations/2018_01_01_000001_create_oauth_auth_codes_table.php
@@ -44,6 +44,7 @@ class CreateOauthAuthCodesTable extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2018_01_01_000002_create_oauth_access_tokens_table.php b/database/migrations/2018_01_01_000002_create_oauth_access_tokens_table.php
index bb9f1cdd93..846d6cded8 100644
--- a/database/migrations/2018_01_01_000002_create_oauth_access_tokens_table.php
+++ b/database/migrations/2018_01_01_000002_create_oauth_access_tokens_table.php
@@ -44,6 +44,7 @@ class CreateOauthAccessTokensTable extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2018_01_01_000003_create_oauth_refresh_tokens_table.php b/database/migrations/2018_01_01_000003_create_oauth_refresh_tokens_table.php
index 324f0e213d..26a44fdd0e 100644
--- a/database/migrations/2018_01_01_000003_create_oauth_refresh_tokens_table.php
+++ b/database/migrations/2018_01_01_000003_create_oauth_refresh_tokens_table.php
@@ -44,6 +44,7 @@ class CreateOauthRefreshTokensTable extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2018_01_01_000004_create_oauth_clients_table.php b/database/migrations/2018_01_01_000004_create_oauth_clients_table.php
index 16ef069c02..ca86388fd2 100644
--- a/database/migrations/2018_01_01_000004_create_oauth_clients_table.php
+++ b/database/migrations/2018_01_01_000004_create_oauth_clients_table.php
@@ -44,6 +44,7 @@ class CreateOauthClientsTable extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2018_01_01_000005_create_oauth_personal_access_clients_table.php b/database/migrations/2018_01_01_000005_create_oauth_personal_access_clients_table.php
index 4dd78aea8c..1c6c711835 100644
--- a/database/migrations/2018_01_01_000005_create_oauth_personal_access_clients_table.php
+++ b/database/migrations/2018_01_01_000005_create_oauth_personal_access_clients_table.php
@@ -44,6 +44,7 @@ class CreateOauthPersonalAccessClientsTable extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2018_03_19_141348_changes_for_v472.php b/database/migrations/2018_03_19_141348_changes_for_v472.php
index 3ee040ca42..e0fc018f3b 100644
--- a/database/migrations/2018_03_19_141348_changes_for_v472.php
+++ b/database/migrations/2018_03_19_141348_changes_for_v472.php
@@ -36,8 +36,6 @@ class ChangesForV472 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -63,7 +61,7 @@ class ChangesForV472 extends Migration
$table->dropColumn('order');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -73,7 +71,6 @@ class ChangesForV472 extends Migration
/**
* Run the migrations.
*
- * @return void
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
@@ -86,7 +83,7 @@ class ChangesForV472 extends Migration
$table->dropColumn('notes');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
diff --git a/database/migrations/2018_04_07_210913_changes_for_v473.php b/database/migrations/2018_04_07_210913_changes_for_v473.php
index e52f0ef5a2..80add3a888 100644
--- a/database/migrations/2018_04_07_210913_changes_for_v473.php
+++ b/database/migrations/2018_04_07_210913_changes_for_v473.php
@@ -37,8 +37,6 @@ class ChangesForV473 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -54,7 +52,7 @@ class ChangesForV473 extends Migration
$table->dropColumn('transaction_currency_id');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -68,7 +66,7 @@ class ChangesForV473 extends Migration
$table->dropColumn('strict');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -77,8 +75,8 @@ class ChangesForV473 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2018_04_29_174524_changes_for_v474.php b/database/migrations/2018_04_29_174524_changes_for_v474.php
index 719f01d4f8..d78013e8ec 100644
--- a/database/migrations/2018_04_29_174524_changes_for_v474.php
+++ b/database/migrations/2018_04_29_174524_changes_for_v474.php
@@ -33,15 +33,12 @@ class ChangesForV474 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void {}
/**
* Run the migrations.
*
- * @return void
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void {}
diff --git a/database/migrations/2018_06_08_200526_changes_for_v475.php b/database/migrations/2018_06_08_200526_changes_for_v475.php
index 2426126da4..85384c9376 100644
--- a/database/migrations/2018_06_08_200526_changes_for_v475.php
+++ b/database/migrations/2018_06_08_200526_changes_for_v475.php
@@ -35,8 +35,6 @@ class ChangesForV475 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -49,8 +47,8 @@ class ChangesForV475 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2018_09_05_195147_changes_for_v477.php b/database/migrations/2018_09_05_195147_changes_for_v477.php
index e93b73cea1..04da77b3da 100644
--- a/database/migrations/2018_09_05_195147_changes_for_v477.php
+++ b/database/migrations/2018_09_05_195147_changes_for_v477.php
@@ -36,8 +36,6 @@ class ChangesForV477 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -54,7 +52,7 @@ class ChangesForV477 extends Migration
$table->dropColumn(['transaction_currency_id']);
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -63,8 +61,8 @@ class ChangesForV477 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2018_11_06_172532_changes_for_v479.php b/database/migrations/2018_11_06_172532_changes_for_v479.php
index 31269943b2..2e7c4bf568 100644
--- a/database/migrations/2018_11_06_172532_changes_for_v479.php
+++ b/database/migrations/2018_11_06_172532_changes_for_v479.php
@@ -36,8 +36,6 @@ class ChangesForV479 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -49,7 +47,7 @@ class ChangesForV479 extends Migration
$table->dropColumn(['enabled']);
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -58,8 +56,8 @@ class ChangesForV479 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2019_01_28_193833_changes_for_v4710.php b/database/migrations/2019_01_28_193833_changes_for_v4710.php
index 118b7848e4..f9c8e46ae9 100644
--- a/database/migrations/2019_01_28_193833_changes_for_v4710.php
+++ b/database/migrations/2019_01_28_193833_changes_for_v4710.php
@@ -36,8 +36,6 @@ class ChangesForV4710 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -47,8 +45,8 @@ class ChangesForV4710 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2019_02_05_055516_changes_for_v4711.php b/database/migrations/2019_02_05_055516_changes_for_v4711.php
index bbdb40e8c7..d3329eb39b 100644
--- a/database/migrations/2019_02_05_055516_changes_for_v4711.php
+++ b/database/migrations/2019_02_05_055516_changes_for_v4711.php
@@ -36,22 +36,17 @@ class ChangesForV4711 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
- public function down(): void
- {
- //
- }
+ public function down(): void {}
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
- /**
+ /*
* In 4.7.11, I changed the date field to a "datetimetz" field. This wreaks havoc
* because apparently MySQL is not actually capable of handling multiple time zones,
* only having a server wide time zone setting. Actual database schemes like Postgres
diff --git a/database/migrations/2019_02_11_170529_changes_for_v4712.php b/database/migrations/2019_02_11_170529_changes_for_v4712.php
index c93ba77ff3..1a796723ef 100644
--- a/database/migrations/2019_02_11_170529_changes_for_v4712.php
+++ b/database/migrations/2019_02_11_170529_changes_for_v4712.php
@@ -35,22 +35,17 @@ class ChangesForV4712 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
- public function down(): void
- {
- //
- }
+ public function down(): void {}
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
- /**
+ /*
* In 4.7.11, I changed the date field to a "datetimetz" field. This wreaks havoc
* because apparently MySQL is not actually capable of handling multiple time zones,
* only having a server wide time zone setting. Actual database schemes like Postgres
diff --git a/database/migrations/2019_03_11_223700_fix_ldap_configuration.php b/database/migrations/2019_03_11_223700_fix_ldap_configuration.php
index 1a896d7f1a..b51861d508 100644
--- a/database/migrations/2019_03_11_223700_fix_ldap_configuration.php
+++ b/database/migrations/2019_03_11_223700_fix_ldap_configuration.php
@@ -36,8 +36,6 @@ class FixLdapConfiguration extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -49,7 +47,7 @@ class FixLdapConfiguration extends Migration
$table->dropColumn(['objectguid']);
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -58,12 +56,12 @@ class FixLdapConfiguration extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
- /**
+ /*
* ADLdap2 appears to require the ability to store an objectguid for LDAP users
* now. To support this, we add the column.
*/
diff --git a/database/migrations/2019_03_22_183214_changes_for_v480.php b/database/migrations/2019_03_22_183214_changes_for_v480.php
index de803caf48..142e77cf94 100644
--- a/database/migrations/2019_03_22_183214_changes_for_v480.php
+++ b/database/migrations/2019_03_22_183214_changes_for_v480.php
@@ -35,8 +35,6 @@ class ChangesForV480 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -56,9 +54,10 @@ class ChangesForV480 extends Migration
app('log')->error('If the foreign ID does not exist (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
+
try {
$table->dropColumn('transaction_group_id');
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -78,7 +77,7 @@ class ChangesForV480 extends Migration
static function (Blueprint $table) {
try {
$table->dropColumn('stop_processing');
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -98,7 +97,7 @@ class ChangesForV480 extends Migration
static function (Blueprint $table) {
try {
$table->dropColumn('mfa_secret');
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -113,8 +112,8 @@ class ChangesForV480 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
@@ -128,7 +127,8 @@ class ChangesForV480 extends Migration
// add column "group_id" after "transaction_type_id"
$table->integer('transaction_group_id', false, true)
- ->nullable()->default(null)->after('transaction_type_id');
+ ->nullable()->default(null)->after('transaction_type_id')
+ ;
// add foreign key for "transaction_group_id"
try {
diff --git a/database/migrations/2019_12_28_191351_make_locations_table.php b/database/migrations/2019_12_28_191351_make_locations_table.php
index 7b3443b06b..72ea6cc018 100644
--- a/database/migrations/2019_12_28_191351_make_locations_table.php
+++ b/database/migrations/2019_12_28_191351_make_locations_table.php
@@ -36,8 +36,6 @@ class MakeLocationsTable extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -46,8 +44,8 @@ class MakeLocationsTable extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2020_03_13_201950_changes_for_v520.php b/database/migrations/2020_03_13_201950_changes_for_v520.php
index 18d254418c..71ea92a1a0 100644
--- a/database/migrations/2020_03_13_201950_changes_for_v520.php
+++ b/database/migrations/2020_03_13_201950_changes_for_v520.php
@@ -34,8 +34,6 @@ class ChangesForV520 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -45,8 +43,8 @@ class ChangesForV520 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2020_06_07_063612_changes_for_v530.php b/database/migrations/2020_06_07_063612_changes_for_v530.php
index b5615f6b24..d07a4048bc 100644
--- a/database/migrations/2020_06_07_063612_changes_for_v530.php
+++ b/database/migrations/2020_06_07_063612_changes_for_v530.php
@@ -35,8 +35,6 @@ class ChangesForV530 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -46,8 +44,8 @@ class ChangesForV530 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2020_06_30_202620_changes_for_v530a.php b/database/migrations/2020_06_30_202620_changes_for_v530a.php
index 2dd5834058..545c82cc8c 100644
--- a/database/migrations/2020_06_30_202620_changes_for_v530a.php
+++ b/database/migrations/2020_06_30_202620_changes_for_v530a.php
@@ -37,8 +37,6 @@ class ChangesForV530a extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -50,7 +48,7 @@ class ChangesForV530a extends Migration
$table->dropColumn('order');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -59,8 +57,8 @@ class ChangesForV530a extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
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 a3acb2f8de..f71a4c8f7f 100644
--- a/database/migrations/2020_07_24_162820_changes_for_v540.php
+++ b/database/migrations/2020_07_24_162820_changes_for_v540.php
@@ -37,8 +37,6 @@ class ChangesForV540 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -50,7 +48,7 @@ class ChangesForV540 extends Migration
$table->dropColumn('provider');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -64,7 +62,7 @@ class ChangesForV540 extends Migration
$table->dropColumn('order');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -78,7 +76,7 @@ class ChangesForV540 extends Migration
$table->dropColumn('end_date');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -91,7 +89,7 @@ class ChangesForV540 extends Migration
$table->dropColumn('extension_date');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -100,8 +98,8 @@ class ChangesForV540 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2020_11_12_070604_changes_for_v550.php b/database/migrations/2020_11_12_070604_changes_for_v550.php
index a08a2c9987..7440735421 100644
--- a/database/migrations/2020_11_12_070604_changes_for_v550.php
+++ b/database/migrations/2020_11_12_070604_changes_for_v550.php
@@ -35,8 +35,6 @@ class ChangesForV550 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -78,7 +76,7 @@ class ChangesForV550 extends Migration
$table->dropColumn('budget_limit_id');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -97,7 +95,7 @@ class ChangesForV550 extends Migration
$table->dropColumn('period');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -110,7 +108,7 @@ class ChangesForV550 extends Migration
$table->dropColumn('generated');
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -124,8 +122,8 @@ class ChangesForV550 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2021_03_12_061213_changes_for_v550b2.php b/database/migrations/2021_03_12_061213_changes_for_v550b2.php
index ac009e6309..a9736d6613 100644
--- a/database/migrations/2021_03_12_061213_changes_for_v550b2.php
+++ b/database/migrations/2021_03_12_061213_changes_for_v550b2.php
@@ -35,8 +35,6 @@ class ChangesForV550b2 extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -53,7 +51,7 @@ class ChangesForV550b2 extends Migration
}
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -62,8 +60,8 @@ class ChangesForV550b2 extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2021_05_09_064644_add_ldap_columns_to_users_table.php b/database/migrations/2021_05_09_064644_add_ldap_columns_to_users_table.php
index e02c16a61c..624b332e77 100644
--- a/database/migrations/2021_05_09_064644_add_ldap_columns_to_users_table.php
+++ b/database/migrations/2021_05_09_064644_add_ldap_columns_to_users_table.php
@@ -43,7 +43,7 @@ class AddLdapColumnsToUsersTable extends Migration
$table->dropColumn(['domain']);
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -52,6 +52,7 @@ class AddLdapColumnsToUsersTable extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
diff --git a/database/migrations/2021_05_13_053836_extend_currency_info.php b/database/migrations/2021_05_13_053836_extend_currency_info.php
index 32ac1506c4..081e931c5a 100644
--- a/database/migrations/2021_05_13_053836_extend_currency_info.php
+++ b/database/migrations/2021_05_13_053836_extend_currency_info.php
@@ -34,18 +34,13 @@ class ExtendCurrencyInfo extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
- public function down(): void
- {
- //
- }
+ public function down(): void {}
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2021_07_05_193044_drop_tele_table.php b/database/migrations/2021_07_05_193044_drop_tele_table.php
index 746c40211d..105cf474d6 100644
--- a/database/migrations/2021_07_05_193044_drop_tele_table.php
+++ b/database/migrations/2021_07_05_193044_drop_tele_table.php
@@ -32,8 +32,6 @@ class DropTeleTable extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -42,8 +40,8 @@ class DropTeleTable extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2021_08_28_073733_user_groups.php b/database/migrations/2021_08_28_073733_user_groups.php
index 76de049742..0e48c875fc 100644
--- a/database/migrations/2021_08_28_073733_user_groups.php
+++ b/database/migrations/2021_08_28_073733_user_groups.php
@@ -53,8 +53,6 @@ class UserGroups extends Migration
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -74,7 +72,7 @@ class UserGroups extends Migration
}
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -94,7 +92,7 @@ class UserGroups extends Migration
}
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
@@ -107,8 +105,8 @@ class UserGroups extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
@@ -175,6 +173,7 @@ class UserGroups extends Migration
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
+
try {
Schema::table(
'users',
@@ -191,6 +190,7 @@ class UserGroups extends Migration
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
+
// ADD columns to tables
/** @var string $tableName */
foreach ($this->tables as $tableName) {
diff --git a/database/migrations/2021_12_27_000001_create_local_personal_access_tokens_table.php b/database/migrations/2021_12_27_000001_create_local_personal_access_tokens_table.php
index 7e438f922e..b341a65e5c 100644
--- a/database/migrations/2021_12_27_000001_create_local_personal_access_tokens_table.php
+++ b/database/migrations/2021_12_27_000001_create_local_personal_access_tokens_table.php
@@ -34,8 +34,6 @@ class CreateLocalPersonalAccessTokensTable extends Migration
{
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -44,8 +42,8 @@ class CreateLocalPersonalAccessTokensTable extends Migration
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
diff --git a/database/migrations/2022_08_21_104626_add_user_groups.php b/database/migrations/2022_08_21_104626_add_user_groups.php
index 222467d847..3b348e0fd7 100644
--- a/database/migrations/2022_08_21_104626_add_user_groups.php
+++ b/database/migrations/2022_08_21_104626_add_user_groups.php
@@ -28,14 +28,11 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-/**
- *
- */
-return new class () extends Migration {
+return new class() extends Migration {
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
@@ -57,8 +54,6 @@ return new class () extends Migration {
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
@@ -74,7 +69,7 @@ return new class () extends Migration {
}
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
diff --git a/database/migrations/2022_09_18_123911_create_notifications_table.php b/database/migrations/2022_09_18_123911_create_notifications_table.php
index 09e4963fa9..862bbb94fd 100644
--- a/database/migrations/2022_09_18_123911_create_notifications_table.php
+++ b/database/migrations/2022_09_18_123911_create_notifications_table.php
@@ -27,11 +27,11 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class () extends Migration {
+return new class() extends Migration {
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
@@ -54,8 +54,6 @@ return new class () extends Migration {
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2022_10_01_074908_invited_users.php b/database/migrations/2022_10_01_074908_invited_users.php
index c2c0de8cc8..84c40cddca 100644
--- a/database/migrations/2022_10_01_074908_invited_users.php
+++ b/database/migrations/2022_10_01_074908_invited_users.php
@@ -27,11 +27,11 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class () extends Migration {
+return new class() extends Migration {
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
@@ -56,8 +56,6 @@ return new class () extends Migration {
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2022_10_01_210238_audit_log_entries.php b/database/migrations/2022_10_01_210238_audit_log_entries.php
index fd64d2915c..57ff51c5a5 100644
--- a/database/migrations/2022_10_01_210238_audit_log_entries.php
+++ b/database/migrations/2022_10_01_210238_audit_log_entries.php
@@ -27,11 +27,11 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class () extends Migration {
+return new class() extends Migration {
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @return void
*/
public function up(): void
{
@@ -61,8 +61,6 @@ return new class () extends Migration {
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_08_11_192521_upgrade_og_table.php b/database/migrations/2023_08_11_192521_upgrade_og_table.php
index 1a01ed8f10..f5e37d2a6a 100644
--- a/database/migrations/2023_08_11_192521_upgrade_og_table.php
+++ b/database/migrations/2023_08_11_192521_upgrade_og_table.php
@@ -1,6 +1,5 @@
<?php
-
/*
* 2023_08_11_192521_upgrade_og_table.php
* Copyright (c) 2023 [email protected]
@@ -29,12 +28,10 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-/**
- *
- */
-return new class () extends Migration {
+return new class() extends Migration {
/**
* Run the migrations.
+ *
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
@@ -74,7 +71,7 @@ return new class () extends Migration {
}
}
);
- } catch (QueryException | ColumnDoesNotExist $e) {
+ } catch (ColumnDoesNotExist|QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
diff --git a/database/migrations/2023_10_21_113213_add_currency_pivot_tables.php b/database/migrations/2023_10_21_113213_add_currency_pivot_tables.php
index 6845c3f0f4..d32ece5411 100644
--- a/database/migrations/2023_10_21_113213_add_currency_pivot_tables.php
+++ b/database/migrations/2023_10_21_113213_add_currency_pivot_tables.php
@@ -1,6 +1,5 @@
<?php
-
/*
* 2023_10_21_113213_add_currency_pivot_tables.php
* Copyright (c) 2023 [email protected]
@@ -28,7 +27,7 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-return new class () extends Migration {
+return new class() extends Migration {
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
* Run the migrations.
diff --git a/database/seeders/AccountTypeSeeder.php b/database/seeders/AccountTypeSeeder.php
index 57ebb11570..7f968ba642 100644
--- a/database/seeders/AccountTypeSeeder.php
+++ b/database/seeders/AccountTypeSeeder.php
@@ -25,7 +25,6 @@ namespace Database\Seeders;
use FireflyIII\Models\AccountType;
use Illuminate\Database\Seeder;
-use PDOException;
/**
* Class AccountTypeSeeder.
@@ -52,7 +51,7 @@ class AccountTypeSeeder extends Seeder
foreach ($types as $type) {
try {
AccountType::create(['type' => $type]);
- } catch (PDOException $e) {
+ } catch (\PDOException $e) {
// @ignoreException
}
}
diff --git a/database/seeders/ExchangeRateSeeder.php b/database/seeders/ExchangeRateSeeder.php
index 164473461e..e687beb754 100644
--- a/database/seeders/ExchangeRateSeeder.php
+++ b/database/seeders/ExchangeRateSeeder.php
@@ -34,14 +34,12 @@ use Illuminate\Database\Seeder;
*/
class ExchangeRateSeeder extends Seeder
{
- /**
- * @return void
- */
public function run(): void
{
$count = User::count();
if (0 === $count) {
app('log')->debug('Will not seed exchange rates yet.');
+
return;
}
$users = User::get();
@@ -73,41 +71,22 @@ class ExchangeRateSeeder extends Seeder
}
}
- /**
- * @param string $code
- *
- * @return TransactionCurrency|null
- */
private function getCurrency(string $code): ?TransactionCurrency
{
return TransactionCurrency::whereNull('deleted_at')->where('code', $code)->first();
}
- /**
- * @param User $user
- * @param TransactionCurrency $from
- * @param TransactionCurrency $to
- * @param string $date
- *
- * @return bool
- */
private function hasRate(User $user, TransactionCurrency $from, TransactionCurrency $to, string $date): bool
{
return $user->currencyExchangeRates()
- ->where('from_currency_id', $from->id)
- ->where('to_currency_id', $to->id)
- ->where('date', $date)
- ->count() > 0;
+ ->where('from_currency_id', $from->id)
+ ->where('to_currency_id', $to->id)
+ ->where('date', $date)
+ ->count() > 0
+ ;
}
/**
- * @param User $user
- * @param TransactionCurrency $from
- * @param TransactionCurrency $to
- * @param string $date
- * @param float $rate
- *
- * @return void
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
private function addRate(User $user, TransactionCurrency $from, TransactionCurrency $to, string $date, float $rate): void
diff --git a/database/seeders/LinkTypeSeeder.php b/database/seeders/LinkTypeSeeder.php
index e115bb2ad8..1dca2fd2a0 100644
--- a/database/seeders/LinkTypeSeeder.php
+++ b/database/seeders/LinkTypeSeeder.php
@@ -25,16 +25,12 @@ namespace Database\Seeders;
use FireflyIII\Models\LinkType;
use Illuminate\Database\Seeder;
-use PDOException;
/**
* Class LinkTypeSeeder.
*/
class LinkTypeSeeder extends Seeder
{
- /**
- * @return void
- */
public function run(): void
{
$types = [
@@ -66,7 +62,7 @@ class LinkTypeSeeder extends Seeder
foreach ($types as $type) {
try {
LinkType::create($type);
- } catch (PDOException $e) {
+ } catch (\PDOException $e) {
// @ignoreException
}
}
diff --git a/database/seeders/PermissionSeeder.php b/database/seeders/PermissionSeeder.php
index 29ff77d72f..76e5106459 100644
--- a/database/seeders/PermissionSeeder.php
+++ b/database/seeders/PermissionSeeder.php
@@ -25,7 +25,6 @@ namespace Database\Seeders;
use FireflyIII\Models\Role;
use Illuminate\Database\Seeder;
-use PDOException;
/**
* Class PermissionSeeder.
@@ -49,7 +48,7 @@ class PermissionSeeder extends Seeder
foreach ($roles as $role) {
try {
Role::create($role);
- } catch (PDOException $e) {
+ } catch (\PDOException $e) {
// @ignoreException
}
}
diff --git a/database/seeders/TransactionCurrencySeeder.php b/database/seeders/TransactionCurrencySeeder.php
index b13752fad8..2c70b4af14 100644
--- a/database/seeders/TransactionCurrencySeeder.php
+++ b/database/seeders/TransactionCurrencySeeder.php
@@ -25,15 +25,12 @@ namespace Database\Seeders;
use FireflyIII\Models\TransactionCurrency;
use Illuminate\Database\Seeder;
-use PDOException;
/**
* Class TransactionCurrencySeeder.
*/
class TransactionCurrencySeeder extends Seeder
{
- /**
- */
public function run(): void
{
$currencies = [];
@@ -76,7 +73,7 @@ class TransactionCurrencySeeder extends Seeder
foreach ($currencies as $currency) {
try {
TransactionCurrency::create($currency);
- } catch (PDOException $e) {
+ } catch (\PDOException $e) {
// @ignoreException
}
}
diff --git a/database/seeders/TransactionTypeSeeder.php b/database/seeders/TransactionTypeSeeder.php
index da0db936fd..1793b3e991 100644
--- a/database/seeders/TransactionTypeSeeder.php
+++ b/database/seeders/TransactionTypeSeeder.php
@@ -25,7 +25,6 @@ namespace Database\Seeders;
use FireflyIII\Models\TransactionType;
use Illuminate\Database\Seeder;
-use PDOException;
/**
* Class TransactionTypeSeeder.
@@ -47,7 +46,7 @@ class TransactionTypeSeeder extends Seeder
foreach ($types as $type) {
try {
TransactionType::create(['type' => $type]);
- } catch (PDOException $e) {
+ } catch (\PDOException $e) {
// @ignoreException
}
}
diff --git a/database/seeders/UserRoleSeeder.php b/database/seeders/UserRoleSeeder.php
index 2eb8dc6059..ee9a680bdb 100644
--- a/database/seeders/UserRoleSeeder.php
+++ b/database/seeders/UserRoleSeeder.php
@@ -27,7 +27,6 @@ namespace Database\Seeders;
use FireflyIII\Enums\UserRoleEnum;
use FireflyIII\Models\UserRole;
use Illuminate\Database\Seeder;
-use PDOException;
/**
* Class UserRoleSeeder
@@ -36,8 +35,6 @@ class UserRoleSeeder extends Seeder
{
/**
* Run the database seeds.
- *
- * @return void
*/
public function run()
{
@@ -50,7 +47,7 @@ class UserRoleSeeder extends Seeder
foreach ($roles as $role) {
try {
UserRole::create(['title' => $role]);
- } catch (PDOException $e) {
+ } catch (\PDOException $e) {
// @ignoreException
}
}