Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Even more code cleanup.
James Cole41562f8f6de4
diff --git a/app/database/migrations/2014_06_27_163032_create_users_table.php b/app/database/migrations/2014_06_27_163032_create_users_table.phpindex c4d20b537e..25cc4349a3 100644--- a/app/database/migrations/2014_06_27_163032_create_users_table.php+++ b/app/database/migrations/2014_06_27_163032_create_users_table.php@@ -1,44 +1,46 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateUsersTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateUsersTable extends Migration {+class CreateUsersTable extends Migration+{- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('users', function(Blueprint $table)- {- $table->increments('id');- $table->timestamps();- $table->string('email',100);- $table->string('password',60);- $table->string('reset',32)->nullable();- $table->string('remember_token',255)->nullable();- $table->boolean('migrated');+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'users', function (Blueprint $table) {+ $table->increments('id');+ $table->timestamps();+ $table->string('email', 100);+ $table->string('password', 60);+ $table->string('reset', 32)->nullable();+ $table->string('remember_token', 255)->nullable();+ $table->boolean('migrated');- $table->unique('email');- });- }+ $table->unique('email');+ }+ );+ }- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('users');- }+ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('users');+ }}diff --git a/app/database/migrations/2014_06_27_163259_create_accounts_table.php b/app/database/migrations/2014_06_27_163259_create_accounts_table.phpindex 2653b4fc65..e98a4d4581 100644--- a/app/database/migrations/2014_06_27_163259_create_accounts_table.php+++ b/app/database/migrations/2014_06_27_163259_create_accounts_table.php@@ -1,53 +1,55 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateAccountsTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateAccountsTable extends Migration {-- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('accounts', function(Blueprint $table)- {- $table->increments('id');- $table->timestamps();- $table->integer('user_id')->unsigned();- $table->integer('account_type_id')->unsigned();- $table->string('name',100);- $table->boolean('active');-- // connect accounts to users- $table->foreign('user_id')- ->references('id')->on('users')- ->onDelete('cascade');-- // connect accounts to account_types- $table->foreign('account_type_id')- ->references('id')->on('account_types')- ->onDelete('cascade');-- $table->unique(['user_id','account_type_id','name']);- });- }-- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('accounts');- }+class CreateAccountsTable extends Migration+{++ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'accounts', function (Blueprint $table) {+ $table->increments('id');+ $table->timestamps();+ $table->integer('user_id')->unsigned();+ $table->integer('account_type_id')->unsigned();+ $table->string('name', 100);+ $table->boolean('active');++ // connect accounts to users+ $table->foreign('user_id')+ ->references('id')->on('users')+ ->onDelete('cascade');++ // connect accounts to account_types+ $table->foreign('account_type_id')+ ->references('id')->on('account_types')+ ->onDelete('cascade');++ $table->unique(['user_id', 'account_type_id', 'name']);+ }+ );+ }++ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('accounts');+ }}diff --git a/app/database/migrations/2014_06_27_163817_create_components_table.php b/app/database/migrations/2014_06_27_163817_create_components_table.phpindex 94dd180c59..998bef4ddf 100644--- a/app/database/migrations/2014_06_27_163817_create_components_table.php+++ b/app/database/migrations/2014_06_27_163817_create_components_table.php@@ -1,48 +1,50 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateComponentsTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateComponentsTable extends Migration {-- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('components', function(Blueprint $table)- {- $table->increments('id');- $table->timestamps();- $table->string('name',50);- $table->integer('user_id')->unsigned();- $table->string('class',20);-- // connect components to users- $table->foreign('user_id')- ->references('id')->on('users')- ->onDelete('cascade');-- $table->unique(['user_id','class','name']);- });-- }-- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('components');- }+class CreateComponentsTable extends Migration+{++ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'components', function (Blueprint $table) {+ $table->increments('id');+ $table->timestamps();+ $table->string('name', 50);+ $table->integer('user_id')->unsigned();+ $table->string('class', 20);++ // connect components to users+ $table->foreign('user_id')+ ->references('id')->on('users')+ ->onDelete('cascade');++ $table->unique(['user_id', 'class', 'name']);+ }+ );++ }++ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('components');+ }}diff --git a/app/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php b/app/database/migrations/2014_06_27_164042_create_transaction_currencies_table.phpindex 1a6de1bce2..64c82f8491 100644--- a/app/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php+++ b/app/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php@@ -1,38 +1,40 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateTransactionCurrenciesTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateTransactionCurrenciesTable extends Migration {+class CreateTransactionCurrenciesTable extends Migration+{- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('transaction_currencies', function(Blueprint $table)- {- $table->increments('id');- $table->timestamps();- $table->string('code',3);- });- }+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'transaction_currencies', function (Blueprint $table) {+ $table->increments('id');+ $table->timestamps();+ $table->string('code', 3);+ }+ );+ }- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('transaction_currencies');- }+ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('transaction_currencies');+ }}diff --git a/app/database/migrations/2014_06_27_164512_create_transaction_types_table.php b/app/database/migrations/2014_06_27_164512_create_transaction_types_table.phpindex e54ab93e89..6cd34a74c5 100644--- a/app/database/migrations/2014_06_27_164512_create_transaction_types_table.php+++ b/app/database/migrations/2014_06_27_164512_create_transaction_types_table.php@@ -1,38 +1,40 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateTransactionTypesTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateTransactionTypesTable extends Migration {+class CreateTransactionTypesTable extends Migration+{- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('transaction_types', function(Blueprint $table)- {- $table->increments('id');- $table->timestamps();- $table->string('type',50);- });- }+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'transaction_types', function (Blueprint $table) {+ $table->increments('id');+ $table->timestamps();+ $table->string('type', 50);+ }+ );+ }- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('transaction_types');- }+ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('transaction_types');+ }}diff --git a/app/database/migrations/2014_06_27_164620_create_transaction_journals_table.php b/app/database/migrations/2014_06_27_164620_create_transaction_journals_table.phpindex 71a559c18d..9c3ed1fd22 100644--- a/app/database/migrations/2014_06_27_164620_create_transaction_journals_table.php+++ b/app/database/migrations/2014_06_27_164620_create_transaction_journals_table.php@@ -1,58 +1,60 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateTransactionJournalsTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateTransactionJournalsTable extends Migration {-- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('transaction_journals', function(Blueprint $table)- {- $table->increments('id');- $table->timestamps();- $table->integer('user_id')->unsigned();- $table->integer('transaction_type_id')->unsigned();- $table->integer('transaction_currency_id')->unsigned();- $table->string('description',255)->nullable();- $table->boolean('completed');- $table->date('date');-- // connect transaction journals to transaction types- $table->foreign('transaction_type_id')- ->references('id')->on('transaction_types')- ->onDelete('cascade');-- // connect transaction journals to transaction currencies- $table->foreign('transaction_currency_id')- ->references('id')->on('transaction_currencies')- ->onDelete('cascade');-- // connect users- $table->foreign('user_id')- ->references('id')->on('users')- ->onDelete('cascade');- });- }-- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('transaction_journals');- }+class CreateTransactionJournalsTable extends Migration+{++ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'transaction_journals', function (Blueprint $table) {+ $table->increments('id');+ $table->timestamps();+ $table->integer('user_id')->unsigned();+ $table->integer('transaction_type_id')->unsigned();+ $table->integer('transaction_currency_id')->unsigned();+ $table->string('description', 255)->nullable();+ $table->boolean('completed');+ $table->date('date');++ // connect transaction journals to transaction types+ $table->foreign('transaction_type_id')+ ->references('id')->on('transaction_types')+ ->onDelete('cascade');++ // connect transaction journals to transaction currencies+ $table->foreign('transaction_currency_id')+ ->references('id')->on('transaction_currencies')+ ->onDelete('cascade');++ // connect users+ $table->foreign('user_id')+ ->references('id')->on('users')+ ->onDelete('cascade');+ }+ );+ }++ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('transaction_journals');+ }}diff --git a/app/database/migrations/2014_06_27_165344_create_component_transaction_table.php b/app/database/migrations/2014_06_27_165344_create_component_transaction_table.phpindex 291aa6dcf4..4c3a2c825a 100644--- a/app/database/migrations/2014_06_27_165344_create_component_transaction_table.php+++ b/app/database/migrations/2014_06_27_165344_create_component_transaction_table.php@@ -1,48 +1,50 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateComponentTransactionTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateComponentTransactionTable extends Migration {+class CreateComponentTransactionTable extends Migration+{- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('component_transaction', function(Blueprint $table)- {- $table->increments('id');- $table->integer('component_id')->unsigned();- $table->integer('transaction_id')->unsigned();+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'component_transaction', function (Blueprint $table) {+ $table->increments('id');+ $table->integer('component_id')->unsigned();+ $table->integer('transaction_id')->unsigned();- // connect to components- $table->foreign('component_id')- ->references('id')->on('components')- ->onDelete('cascade');+ // connect to components+ $table->foreign('component_id')+ ->references('id')->on('components')+ ->onDelete('cascade');- // connect to transactions- $table->foreign('transaction_id')- ->references('id')->on('transactions')- ->onDelete('cascade');- });- }+ // connect to transactions+ $table->foreign('transaction_id')+ ->references('id')->on('transactions')+ ->onDelete('cascade');+ }+ );+ }- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('component_transaction');- }+ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('component_transaction');+ }}diff --git a/app/database/migrations/2014_07_05_100651_create_piggybanks_table.php b/app/database/migrations/2014_07_05_100651_create_piggybanks_table.phpindex 6bed480a93..125d15a86b 100644--- a/app/database/migrations/2014_07_05_100651_create_piggybanks_table.php+++ b/app/database/migrations/2014_07_05_100651_create_piggybanks_table.php@@ -33,7 +33,7 @@ class CreatePiggybanksTable extends Migration$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');- $table->unique(['account_id','name']);+ $table->unique(['account_id', 'name']);});diff --git a/app/database/migrations/2014_07_05_143244_create_recurring_transactions_table.php b/app/database/migrations/2014_07_05_143244_create_recurring_transactions_table.phpindex d9be3d7106..caea6c2d90 100644--- a/app/database/migrations/2014_07_05_143244_create_recurring_transactions_table.php+++ b/app/database/migrations/2014_07_05_143244_create_recurring_transactions_table.php@@ -1,52 +1,54 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateRecurringTransactionsTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateRecurringTransactionsTable extends Migration {-- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('recurring_transactions', function(Blueprint $table)- {- $table->increments('id');- $table->timestamps();- $table->integer('user_id')->unsigned();- $table->string('name',50);- $table->string('match',255);- $table->decimal('amount_max',10,2);- $table->decimal('amount_min',10,2);- $table->date('date');- $table->boolean('active');-- $table->boolean('automatch');- $table->enum('repeat_freq', ['daily', 'weekly','monthly','quarterly','half-year','yearly']);- $table->smallInteger('skip')->unsigned();-- $table->unique(['user_id','name']);--- });- }-- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('recurring_transactions');- }+class CreateRecurringTransactionsTable extends Migration+{++ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'recurring_transactions', function (Blueprint $table) {+ $table->increments('id');+ $table->timestamps();+ $table->integer('user_id')->unsigned();+ $table->string('name', 50);+ $table->string('match', 255);+ $table->decimal('amount_max', 10, 2);+ $table->decimal('amount_min', 10, 2);+ $table->date('date');+ $table->boolean('active');++ $table->boolean('automatch');+ $table->enum('repeat_freq', ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly']);+ $table->smallInteger('skip')->unsigned();++ $table->unique(['user_id', 'name']);+++ }+ );+ }++ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('recurring_transactions');+ }}diff --git a/app/database/migrations/2014_07_05_171326_create_component_transaction_journal_table.php b/app/database/migrations/2014_07_05_171326_create_component_transaction_journal_table.phpindex a98d4fef02..1d4b9c5f51 100644--- a/app/database/migrations/2014_07_05_171326_create_component_transaction_journal_table.php+++ b/app/database/migrations/2014_07_05_171326_create_component_transaction_journal_table.php@@ -1,48 +1,50 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateComponentTransactionJournalTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateComponentTransactionJournalTable extends Migration {+class CreateComponentTransactionJournalTable extends Migration+{- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('component_transaction_journal', function(Blueprint $table)- {- $table->increments('id');- $table->integer('component_id')->unsigned();- $table->integer('transaction_journal_id')->unsigned();+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'component_transaction_journal', function (Blueprint $table) {+ $table->increments('id');+ $table->integer('component_id')->unsigned();+ $table->integer('transaction_journal_id')->unsigned();- // link components with component_id- $table->foreign('component_id')- ->references('id')->on('components')- ->onDelete('cascade');+ // link components with component_id+ $table->foreign('component_id')+ ->references('id')->on('components')+ ->onDelete('cascade');- // link transaction journals with transaction_journal_id- $table->foreign('transaction_journal_id')- ->references('id')->on('transaction_journals')- ->onDelete('cascade');- });- }+ // link transaction journals with transaction_journal_id+ $table->foreign('transaction_journal_id')+ ->references('id')->on('transaction_journals')+ ->onDelete('cascade');+ }+ );+ }- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('component_transaction_journal');- }+ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('component_transaction_journal');+ }}diff --git a/app/database/migrations/2014_07_09_204843_create_session_table.php b/app/database/migrations/2014_07_09_204843_create_session_table.phpindex d5f9867866..7e29be1cce 100644--- a/app/database/migrations/2014_07_09_204843_create_session_table.php+++ b/app/database/migrations/2014_07_09_204843_create_session_table.php@@ -7,31 +7,33 @@ use Illuminate\Database\Migrations\Migration;** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateSessionTable extends Migration {+class CreateSessionTable extends Migration+{- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('sessions', function($t)- {- $t->string('id')->unique();- $t->text('payload');- $t->integer('last_activity');- });- }+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'sessions', function ($t) {+ $t->string('id')->unique();+ $t->text('payload');+ $t->integer('last_activity');+ }+ );+ }- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('sessions');- }+ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('sessions');+ }}diff --git a/app/database/migrations/2014_07_17_183717_create_limits_table.php b/app/database/migrations/2014_07_17_183717_create_limits_table.phpindex 356e146924..0edb4a17c8 100644--- a/app/database/migrations/2014_07_17_183717_create_limits_table.php+++ b/app/database/migrations/2014_07_17_183717_create_limits_table.php@@ -1,49 +1,51 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateLimitsTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateLimitsTable extends Migration {+class CreateLimitsTable extends Migration+{- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('limits', function(Blueprint $table)- {- $table->increments('id');- $table->timestamps();- $table->integer('component_id')->unsigned();- $table->date('startdate');- $table->decimal('amount',10,2);- $table->boolean('repeats');- $table->enum('repeat_freq', ['daily', 'weekly','monthly','quarterly','half-year','yearly']);+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'limits', function (Blueprint $table) {+ $table->increments('id');+ $table->timestamps();+ $table->integer('component_id')->unsigned();+ $table->date('startdate');+ $table->decimal('amount', 10, 2);+ $table->boolean('repeats');+ $table->enum('repeat_freq', ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly']);- $table->unique(['component_id','startdate','repeat_freq']);+ $table->unique(['component_id', 'startdate', 'repeat_freq']);- // connect component- $table->foreign('component_id')- ->references('id')->on('components')- ->onDelete('cascade');- });- }+ // connect component+ $table->foreign('component_id')+ ->references('id')->on('components')+ ->onDelete('cascade');+ }+ );+ }- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('limits');- }+ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('limits');+ }}diff --git a/app/database/migrations/2014_07_19_055011_create_limit_repeat_table.php b/app/database/migrations/2014_07_19_055011_create_limit_repeat_table.phpindex 7a636d919f..f0578b463a 100644--- a/app/database/migrations/2014_07_19_055011_create_limit_repeat_table.php+++ b/app/database/migrations/2014_07_19_055011_create_limit_repeat_table.php@@ -1,48 +1,50 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class CreateLimitRepeatTable** @SuppressWarnings(PHPMD.ShortMethodName)*/-class CreateLimitRepeatTable extends Migration {+class CreateLimitRepeatTable extends Migration+{- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('limit_repetitions', function(Blueprint $table)- {- $table->increments('id');- $table->timestamps();- $table->integer('limit_id')->unsigned();- $table->date('startdate');- $table->date('enddate');- $table->decimal('amount',10,2);+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'limit_repetitions', function (Blueprint $table) {+ $table->increments('id');+ $table->timestamps();+ $table->integer('limit_id')->unsigned();+ $table->date('startdate');+ $table->date('enddate');+ $table->decimal('amount', 10, 2);- $table->unique(['limit_id','startdate','enddate']);+ $table->unique(['limit_id', 'startdate', 'enddate']);- // connect limit- $table->foreign('limit_id')- ->references('id')->on('limits')- ->onDelete('cascade');- });- }+ // connect limit+ $table->foreign('limit_id')+ ->references('id')->on('limits')+ ->onDelete('cascade');+ }+ );+ }- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('limit_repetitions');- }+ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('limit_repetitions');+ }}diff --git a/app/database/migrations/2014_08_06_044416_recurring_transactions_to_components.php b/app/database/migrations/2014_08_06_044416_recurring_transactions_to_components.phpindex 819041d176..18a789b4bd 100644--- a/app/database/migrations/2014_08_06_044416_recurring_transactions_to_components.php+++ b/app/database/migrations/2014_08_06_044416_recurring_transactions_to_components.php@@ -1,49 +1,51 @@<?php-use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;/*** Class RecurringTransactionsToComponents** @SuppressWarnings(PHPMD.ShortMethodName)*/-class RecurringTransactionsToComponents extends Migration {+class RecurringTransactionsToComponents extends Migration+{- /**- * Run the migrations.- *- * @return void- */- public function up()- {- Schema::create('component_recurring_transaction', function(Blueprint $table)- {- $table->increments('id');- $table->integer('component_id')->unsigned();- $table->integer('recurring_transaction_id')->unsigned();- $table->boolean('optional');+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::create(+ 'component_recurring_transaction', function (Blueprint $table) {+ $table->increments('id');+ $table->integer('component_id')->unsigned();+ $table->integer('recurring_transaction_id')->unsigned();+ $table->boolean('optional');- // link components with component_id- $table->foreign('component_id')- ->references('id')->on('components')- ->onDelete('cascade');+ // link components with component_id+ $table->foreign('component_id')+ ->references('id')->on('components')+ ->onDelete('cascade');- // link transaction journals with transaction_journal_id- $table->foreign('recurring_transaction_id')- ->references('id')->on('recurring_transactions')- ->onDelete('cascade');- });- }+ // link transaction journals with transaction_journal_id+ $table->foreign('recurring_transaction_id')+ ->references('id')->on('recurring_transactions')+ ->onDelete('cascade');+ }+ );+ }- /**- * Reverse the migrations.- *- * @return void- */- public function down()- {- Schema::drop('component_recurring_transaction');- }+ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::drop('component_recurring_transaction');+ }}diff --git a/app/lib/Firefly/Helper/Controllers/Chart.php b/app/lib/Firefly/Helper/Controllers/Chart.phpindex 2949b7fd46..2a163d011f 100644--- a/app/lib/Firefly/Helper/Controllers/Chart.php+++ b/app/lib/Firefly/Helper/Controllers/Chart.php@@ -27,9 +27,6 @@ class Chart implements ChartInterface$return = ['name' => $account->name, 'id' => $account->id, 'data' => []];while ($current <= $end) {- \Log::debug(- 'Now at day: ' . $current . '(' . $current->timestamp . '), (' . ($current->timestamp * 1000) . ') '- );if ($current > $today) {$return['data'][] = [$current->timestamp * 1000, $account->predict(clone $current)];} else {@@ -118,9 +115,6 @@ class Chart implements ChartInterface}])->orderBy('name', 'ASC')->get();- $limitInPeriod = 'Envelope for (empty)';- $spentInPeriod = 'Spent in (empty)';-foreach ($budgets as $budget) {$budget->count = 0;foreach ($budget->limits as $limit) {diff --git a/app/lib/Firefly/Helper/Form/FormTrigger.php b/app/lib/Firefly/Helper/Form/FormTrigger.phpindex 187625dc27..44937c72fa 100644--- a/app/lib/Firefly/Helper/Form/FormTrigger.php+++ b/app/lib/Firefly/Helper/Form/FormTrigger.php@@ -3,6 +3,7 @@namespace Firefly\Helper\Form;use Illuminate\Events\Dispatcher;+/*** Class FormTrigger*diff --git a/app/lib/Firefly/Helper/Migration/MigrationHelper.php b/app/lib/Firefly/Helper/Migration/MigrationHelper.phpindex 477072829f..0969abc0d6 100644--- a/app/lib/Firefly/Helper/Migration/MigrationHelper.php+++ b/app/lib/Firefly/Helper/Migration/MigrationHelper.php@@ -142,6 +142,7 @@ class MigrationHelper implements MigrationHelperInterfaceforeach ($this->JSON->components as $entry) {switch ($entry->type->type) {case 'beneficiary':+ /** @noinspection PhpParamsInspection */$beneficiary = $this->_importBeneficiary($entry, $beneficiaryAT);$this->map['accounts'][$entry->id] = $beneficiary;break;diff --git a/app/lib/Firefly/Storage/Account/EloquentAccountRepository.php b/app/lib/Firefly/Storage/Account/EloquentAccountRepository.phpindex 4d42ef9cbf..0b89f567dc 100644--- a/app/lib/Firefly/Storage/Account/EloquentAccountRepository.php+++ b/app/lib/Firefly/Storage/Account/EloquentAccountRepository.php@@ -62,6 +62,8 @@ class EloquentAccountRepository implements AccountRepositoryInterface}$type = \AccountType::where('description', 'Beneficiary account')->first();+ /** @noinspection PhpParamsInspection */+return $this->createOrFind($name, $type);}diff --git a/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php b/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.phpindex 11a20c1b55..062b502483 100644--- a/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php+++ b/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php@@ -122,7 +122,7 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito$fromTransaction->amount = $amountFrom;if (!$fromTransaction->validate()) {throw new FireflyException('Cannot create valid transaction (from): ' . $fromTransaction->errors()->first(- ));+ ));}$fromTransaction->save();@@ -141,6 +141,7 @@ class EloquentTransactionJournalRepository implements TransactionJournalRepositoreturn $journal;}+/*** @param $journalId*diff --git a/app/models/Account.php b/app/models/Account.phpindex 291f836d0f..7ec36d36a7 100644--- a/app/models/Account.php+++ b/app/models/Account.php@@ -62,16 +62,6 @@ class Account extends Ardentreturn $this->belongsTo('AccountType');}- /**- * User- *- * @return \Illuminate\Database\Eloquent\Relations\BelongsTo- */- public function user()- {- return $this->belongsTo('User');- }-/*** Get an accounts current balance.*@@ -92,24 +82,36 @@ class Account extends Ardent);}+ /**+ * Transactions.+ *+ * @return \Illuminate\Database\Eloquent\Relations\HasMany+ */+ public function transactions()+ {+ return $this->hasMany('Transaction');+ }+/*** @param \Carbon\Carbon $date** @return null*/- public function predict(\Carbon\Carbon $date)- {+ public function predict(+ /** @noinspection PhpUnusedParameterInspection */+ \Carbon\Carbon $date+ ) {return null;}/**- * Transactions.+ * User*- * @return \Illuminate\Database\Eloquent\Relations\HasMany+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo*/- public function transactions()+ public function user(){- return $this->hasMany('Transaction');+ return $this->belongsTo('User');}}\ No newline at end of filediff --git a/app/tests/TestCase.php b/app/tests/TestCase.phpindex 4431c97948..c291be445a 100644--- a/app/tests/TestCase.php+++ b/app/tests/TestCase.php@@ -14,8 +14,10 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase*/public function createApplication(){+ /** @noinspection PhpUnusedLocalVariableInspection */$unitTesting = true;+ /** @noinspection PhpUnusedLocalVariableInspection */$testEnvironment = 'testing';return require __DIR__ . '/../../bootstrap/start.php';