Skip to content

Firefly III: a personal finances manager

Code cleanup [skip ci]

James Colec8f52a1c40e5
diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php
index 923658054f..bcd5edae50 100644
--- a/database/factories/ModelFactory.php
+++ b/database/factories/ModelFactory.php
@@ -118,17 +118,17 @@ $factory->define(
FireflyIII\Models\Bill::class,
function (Faker\Generator $faker) {
return [
- 'created_at' => new Carbon,
- 'updated_at' => new Carbon,
- 'user_id' => 1,
- 'name' => $faker->words(3, true),
- 'match' => $faker->words(3, true),
- 'amount_min' => '100.00',
- 'amount_max' => '100.00',
- 'date' => '2017-01-01',
- 'repeat_freq' => 'monthly',
- 'skip' => 0,
- 'automatch' => 1
+ 'created_at' => new Carbon,
+ 'updated_at' => new Carbon,
+ 'user_id' => 1,
+ 'name' => $faker->words(3, true),
+ 'match' => $faker->words(3, true),
+ 'amount_min' => '100.00',
+ 'amount_max' => '100.00',
+ 'date' => '2017-01-01',
+ 'repeat_freq' => 'monthly',
+ 'skip' => 0,
+ 'automatch' => 1,
];
}
);
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 3562b28bca..9ea338668d 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
@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
-
-
-/**
+/*
* 2018_01_01_000001_create_oauth_auth_codes_table.php
* Copyright (c) 2018 [email protected]
*
@@ -23,39 +21,37 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthAuthCodesTable
*/
class CreateOauthAuthCodesTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ */
+ public function down()
+ {
+ Schema::drop('oauth_auth_codes');
+ }
+
/**
* Run the migrations.
- *
- * @return void
*/
public function up()
{
- Schema::create('oauth_auth_codes', function (Blueprint $table) {
+ Schema::create(
+ 'oauth_auth_codes', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->integer('user_id');
$table->integer('client_id');
$table->text('scopes')->nullable();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('oauth_auth_codes');
+ }
+ );
}
}
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 4fa3229a52..4c9574d3e8 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
@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
-
-
-/**
+/*
* 2018_01_01_000002_create_oauth_access_tokens_table.php
* Copyright (c) 2018 [email protected]
*
@@ -23,23 +21,30 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthAccessTokensTable
*/
class CreateOauthAccessTokensTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ */
+ public function down()
+ {
+ Schema::drop('oauth_access_tokens');
+ }
+
/**
* Run the migrations.
- *
- * @return void
*/
public function up()
{
- Schema::create('oauth_access_tokens', function (Blueprint $table) {
+ Schema::create(
+ 'oauth_access_tokens', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->integer('user_id')->index()->nullable();
$table->integer('client_id');
@@ -48,16 +53,7 @@ class CreateOauthAccessTokensTable extends Migration
$table->boolean('revoked');
$table->timestamps();
$table->dateTime('expires_at')->nullable();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('oauth_access_tokens');
+ }
+ );
}
}
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 eb739dc23c..db3a09a15e 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
@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
-
-
-/**
+/*
* 2018_01_01_000003_create_oauth_refresh_tokens_table.php
* Copyright (c) 2018 [email protected]
*
@@ -23,37 +21,35 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthRefreshTokensTable
*/
class CreateOauthRefreshTokensTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ */
+ public function down()
+ {
+ Schema::drop('oauth_refresh_tokens');
+ }
+
/**
* Run the migrations.
- *
- * @return void
*/
public function up()
{
- Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
+ Schema::create(
+ 'oauth_refresh_tokens', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->string('access_token_id', 100)->index();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('oauth_refresh_tokens');
+ }
+ );
}
}
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 3d7cd186cd..7a93146474 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
@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
-
-
-/**
+/*
* 2018_01_01_000004_create_oauth_clients_table.php
* Copyright (c) 2018 [email protected]
*
@@ -23,23 +21,30 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthClientsTable
*/
class CreateOauthClientsTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ */
+ public function down()
+ {
+ Schema::drop('oauth_clients');
+ }
+
/**
* Run the migrations.
- *
- * @return void
*/
public function up()
{
- Schema::create('oauth_clients', function (Blueprint $table) {
+ Schema::create(
+ 'oauth_clients', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->index()->nullable();
$table->string('name');
@@ -49,16 +54,7 @@ class CreateOauthClientsTable extends Migration
$table->boolean('password_client');
$table->boolean('revoked');
$table->timestamps();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('oauth_clients');
+ }
+ );
}
}
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 c1191fbad5..9ec29ce525 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
@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
-
-
-/**
+/*
* 2018_01_01_000005_create_oauth_personal_access_clients_table.php
* Copyright (c) 2018 [email protected]
*
@@ -23,9 +21,9 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
/**
* Class CreateOauthPersonalAccessClientsTable
@@ -33,26 +31,24 @@ use Illuminate\Database\Migrations\Migration;
class CreateOauthPersonalAccessClientsTable extends Migration
{
/**
- * Run the migrations.
- *
- * @return void
+ * Reverse the migrations.
*/
- public function up()
+ public function down()
{
- Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
- $table->increments('id');
- $table->integer('client_id')->index();
- $table->timestamps();
- });
+ Schema::drop('oauth_personal_access_clients');
}
/**
- * Reverse the migrations.
- *
- * @return void
+ * Run the migrations.
*/
- public function down()
+ public function up()
{
- Schema::drop('oauth_personal_access_clients');
+ Schema::create(
+ 'oauth_personal_access_clients', function (Blueprint $table) {
+ $table->increments('id');
+ $table->integer('client_id')->index();
+ $table->timestamps();
+ }
+ );
}
}
diff --git a/database/seeds/ConfigSeeder.php b/database/seeds/ConfigSeeder.php
index d28f066b31..73a3955c03 100644
--- a/database/seeds/ConfigSeeder.php
+++ b/database/seeds/ConfigSeeder.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
use FireflyIII\Models\Configuration;
use Illuminate\Database\Seeder;
@@ -10,8 +10,6 @@ class ConfigSeeder extends Seeder
{
/**
* Run the database seeds.
- *
- * @return void
*/
public function run()
{
diff --git a/database/seeds/LinkTypeSeeder.php b/database/seeds/LinkTypeSeeder.php
index 56fe78d7e8..9528a46fb7 100644
--- a/database/seeds/LinkTypeSeeder.php
+++ b/database/seeds/LinkTypeSeeder.php
@@ -65,6 +65,5 @@ class LinkTypeSeeder extends Seeder
Log::warning(sprintf('Could not create link type "%s". It might exist already.', $type['name']));
}
}
-
}
}
diff --git a/database/seeds/PermissionSeeder.php b/database/seeds/PermissionSeeder.php
index 2b8e1c202d..445251b585 100644
--- a/database/seeds/PermissionSeeder.php
+++ b/database/seeds/PermissionSeeder.php
@@ -49,6 +49,5 @@ class PermissionSeeder extends Seeder
Log::warning(sprintf('Could not create role "%s". It might exist already.', $role['display_name']));
}
}
-
}
}
diff --git a/database/seeds/TransactionTypeSeeder.php b/database/seeds/TransactionTypeSeeder.php
index 809e5260cb..879e29733e 100644
--- a/database/seeds/TransactionTypeSeeder.php
+++ b/database/seeds/TransactionTypeSeeder.php
@@ -45,6 +45,5 @@ class TransactionTypeSeeder extends Seeder
Log::warning(sprintf('Could not create transaction type "%s". It might exist already.', $type));
}
}
-
}
}