Code cleanup [skip ci]

This commit is contained in:
James Cole
2018-03-11 20:41:03 +01:00
parent eb63090387
commit c8f52a1c40
10 changed files with 92 additions and 117 deletions

View File

@@ -118,17 +118,17 @@ $factory->define(
FireflyIII\Models\Bill::class, FireflyIII\Models\Bill::class,
function (Faker\Generator $faker) { function (Faker\Generator $faker) {
return [ return [
'created_at' => new Carbon, 'created_at' => new Carbon,
'updated_at' => new Carbon, 'updated_at' => new Carbon,
'user_id' => 1, 'user_id' => 1,
'name' => $faker->words(3, true), 'name' => $faker->words(3, true),
'match' => $faker->words(3, true), 'match' => $faker->words(3, true),
'amount_min' => '100.00', 'amount_min' => '100.00',
'amount_max' => '100.00', 'amount_max' => '100.00',
'date' => '2017-01-01', 'date' => '2017-01-01',
'repeat_freq' => 'monthly', 'repeat_freq' => 'monthly',
'skip' => 0, 'skip' => 0,
'automatch' => 1 'automatch' => 1,
]; ];
} }
); );

View File

@@ -1,9 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
/*
/**
* 2018_01_01_000001_create_oauth_auth_codes_table.php * 2018_01_01_000001_create_oauth_auth_codes_table.php
* Copyright (c) 2018 thegrumpydictator@gmail.com * Copyright (c) 2018 thegrumpydictator@gmail.com
* *
@@ -23,39 +21,37 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * 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\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/** /**
* Class CreateOauthAuthCodesTable * Class CreateOauthAuthCodesTable
*/ */
class CreateOauthAuthCodesTable extends Migration class CreateOauthAuthCodesTable extends Migration
{ {
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop('oauth_auth_codes');
}
/** /**
* Run the migrations. * Run the migrations.
*
* @return void
*/ */
public function up() 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->string('id', 100)->primary();
$table->integer('user_id'); $table->integer('user_id');
$table->integer('client_id'); $table->integer('client_id');
$table->text('scopes')->nullable(); $table->text('scopes')->nullable();
$table->boolean('revoked'); $table->boolean('revoked');
$table->dateTime('expires_at')->nullable(); $table->dateTime('expires_at')->nullable();
}); }
} );
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('oauth_auth_codes');
} }
} }

View File

@@ -1,9 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
/*
/**
* 2018_01_01_000002_create_oauth_access_tokens_table.php * 2018_01_01_000002_create_oauth_access_tokens_table.php
* Copyright (c) 2018 thegrumpydictator@gmail.com * Copyright (c) 2018 thegrumpydictator@gmail.com
* *
@@ -23,23 +21,30 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * 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\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/** /**
* Class CreateOauthAccessTokensTable * Class CreateOauthAccessTokensTable
*/ */
class CreateOauthAccessTokensTable extends Migration class CreateOauthAccessTokensTable extends Migration
{ {
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop('oauth_access_tokens');
}
/** /**
* Run the migrations. * Run the migrations.
*
* @return void
*/ */
public function up() 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->string('id', 100)->primary();
$table->integer('user_id')->index()->nullable(); $table->integer('user_id')->index()->nullable();
$table->integer('client_id'); $table->integer('client_id');
@@ -48,16 +53,7 @@ class CreateOauthAccessTokensTable extends Migration
$table->boolean('revoked'); $table->boolean('revoked');
$table->timestamps(); $table->timestamps();
$table->dateTime('expires_at')->nullable(); $table->dateTime('expires_at')->nullable();
}); }
} );
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('oauth_access_tokens');
} }
} }

View File

@@ -1,9 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
/*
/**
* 2018_01_01_000003_create_oauth_refresh_tokens_table.php * 2018_01_01_000003_create_oauth_refresh_tokens_table.php
* Copyright (c) 2018 thegrumpydictator@gmail.com * Copyright (c) 2018 thegrumpydictator@gmail.com
* *
@@ -23,37 +21,35 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * 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\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/** /**
* Class CreateOauthRefreshTokensTable * Class CreateOauthRefreshTokensTable
*/ */
class CreateOauthRefreshTokensTable extends Migration 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. * Reverse the migrations.
*
* @return void
*/ */
public function down() public function down()
{ {
Schema::drop('oauth_refresh_tokens'); 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();
}
);
}
} }

View File

@@ -1,9 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
/*
/**
* 2018_01_01_000004_create_oauth_clients_table.php * 2018_01_01_000004_create_oauth_clients_table.php
* Copyright (c) 2018 thegrumpydictator@gmail.com * Copyright (c) 2018 thegrumpydictator@gmail.com
* *
@@ -23,23 +21,30 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * 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\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/** /**
* Class CreateOauthClientsTable * Class CreateOauthClientsTable
*/ */
class CreateOauthClientsTable extends Migration class CreateOauthClientsTable extends Migration
{ {
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop('oauth_clients');
}
/** /**
* Run the migrations. * Run the migrations.
*
* @return void
*/ */
public function up() public function up()
{ {
Schema::create('oauth_clients', function (Blueprint $table) { Schema::create(
'oauth_clients', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->integer('user_id')->index()->nullable(); $table->integer('user_id')->index()->nullable();
$table->string('name'); $table->string('name');
@@ -49,16 +54,7 @@ class CreateOauthClientsTable extends Migration
$table->boolean('password_client'); $table->boolean('password_client');
$table->boolean('revoked'); $table->boolean('revoked');
$table->timestamps(); $table->timestamps();
}); }
} );
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('oauth_clients');
} }
} }

View File

@@ -1,9 +1,7 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
/*
/**
* 2018_01_01_000005_create_oauth_personal_access_clients_table.php * 2018_01_01_000005_create_oauth_personal_access_clients_table.php
* Copyright (c) 2018 thegrumpydictator@gmail.com * Copyright (c) 2018 thegrumpydictator@gmail.com
* *
@@ -23,36 +21,34 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * 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\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/** /**
* Class CreateOauthPersonalAccessClientsTable * Class CreateOauthPersonalAccessClientsTable
*/ */
class CreateOauthPersonalAccessClientsTable extends Migration 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. * Reverse the migrations.
*
* @return void
*/ */
public function down() public function down()
{ {
Schema::drop('oauth_personal_access_clients'); 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();
}
);
}
} }

View File

@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use FireflyIII\Models\Configuration; use FireflyIII\Models\Configuration;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
@@ -10,8 +10,6 @@ class ConfigSeeder extends Seeder
{ {
/** /**
* Run the database seeds. * Run the database seeds.
*
* @return void
*/ */
public function run() public function run()
{ {

View File

@@ -65,6 +65,5 @@ class LinkTypeSeeder extends Seeder
Log::warning(sprintf('Could not create link type "%s". It might exist already.', $type['name'])); Log::warning(sprintf('Could not create link type "%s". It might exist already.', $type['name']));
} }
} }
} }
} }

View File

@@ -49,6 +49,5 @@ class PermissionSeeder extends Seeder
Log::warning(sprintf('Could not create role "%s". It might exist already.', $role['display_name'])); Log::warning(sprintf('Could not create role "%s". It might exist already.', $role['display_name']));
} }
} }
} }
} }

View File

@@ -45,6 +45,5 @@ class TransactionTypeSeeder extends Seeder
Log::warning(sprintf('Could not create transaction type "%s". It might exist already.', $type)); Log::warning(sprintf('Could not create transaction type "%s". It might exist already.', $type));
} }
} }
} }
} }