From c8f52a1c40e527105ec472e90ae2c45d7e853eb0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 11 Mar 2018 20:41:03 +0100 Subject: [PATCH] Code cleanup [skip ci] --- database/factories/ModelFactory.php | 22 +++++----- ...1_000001_create_oauth_auth_codes_table.php | 34 +++++++--------- ...00002_create_oauth_access_tokens_table.php | 34 +++++++--------- ...0003_create_oauth_refresh_tokens_table.php | 40 +++++++++---------- ...1_01_000004_create_oauth_clients_table.php | 34 +++++++--------- ...te_oauth_personal_access_clients_table.php | 38 ++++++++---------- database/seeds/ConfigSeeder.php | 4 +- database/seeds/LinkTypeSeeder.php | 1 - database/seeds/PermissionSeeder.php | 1 - database/seeds/TransactionTypeSeeder.php | 1 - 10 files changed, 92 insertions(+), 117 deletions(-) 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 @@ . */ -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 @@ . */ -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 @@ . */ -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 { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - 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'); } + + /** + * Run the migrations. + */ + public function up() + { + 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(); + } + ); + } } 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 @@ . */ -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 @@ . */ -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 */ class CreateOauthPersonalAccessClientsTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('oauth_personal_access_clients', function (Blueprint $table) { - $table->increments('id'); - $table->integer('client_id')->index(); - $table->timestamps(); - }); - } - /** * Reverse the migrations. - * - * @return void */ public function down() { Schema::drop('oauth_personal_access_clients'); } + + /** + * Run the migrations. + */ + public function up() + { + 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 @@ -