Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Some code cleanup.
James Cole08b5e66628e0
diff --git a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.phpindex 7129260109..f0f3cce9a5 100644--- a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php+++ b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php@@ -161,7 +161,7 @@ class ChartJsBudgetChartGenerator implements BudgetChartGeneratorInterface}// also add "no budget"$data['labels'][] = strval(trans('firefly.no_budget'));-+/** @var array $entry */foreach ($entries as $entry) {$array = [diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.phpindex bfd184d0e3..fe39b4aedf 100644--- a/app/Http/Controllers/Auth/AuthController.php+++ b/app/Http/Controllers/Auth/AuthController.php@@ -7,7 +7,6 @@ use Auth;use FireflyIII\Events\UserRegistration;use FireflyIII\Exceptions\FireflyException;use FireflyIII\Http\Controllers\Controller;-use FireflyIII\Repositories\User\UserRepositoryInterface;use FireflyIII\User;use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;use Illuminate\Foundation\Auth\ThrottlesLogins;diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.phpindex 56f0900feb..669caf9485 100644--- a/app/Http/Controllers/Controller.php+++ b/app/Http/Controllers/Controller.php@@ -41,8 +41,8 @@ class Controller extends BaseControllerView::share('hideTags', false);if (Auth::check()) {- $pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'));- $lang = $pref->data;+ $pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'));+ $lang = $pref->data;App::setLocale($lang);Carbon::setLocale(substr($lang, 0, 2));diff --git a/app/Http/Kernel.php b/app/Http/Kernel.phpindex 930687c575..b59b2b02de 100644--- a/app/Http/Kernel.php+++ b/app/Http/Kernel.php@@ -50,7 +50,7 @@ class Kernel extends HttpKernel// does not check login// does not check 2fa// does not check activation- 'web' => [+ 'web' => [EncryptCookies::class,AddQueuedCookiesToResponse::class,StartSession::class,@@ -58,7 +58,7 @@ class Kernel extends HttpKernelVerifyCsrfToken::class,],// MUST NOT be logged in. Does not care about 2FA or confirmation.- 'user-not-logged-in' => [+ 'user-not-logged-in' => [EncryptCookies::class,AddQueuedCookiesToResponse::class,StartSession::class,@@ -70,7 +70,7 @@ class Kernel extends HttpKernel// MUST be logged in.// MUST NOT have 2FA// don't care about confirmation:- 'user-logged-in-no-2fa' => [+ 'user-logged-in-no-2fa' => [EncryptCookies::class,AddQueuedCookiesToResponse::class,StartSession::class,@@ -82,7 +82,7 @@ class Kernel extends HttpKernel// MUST be logged in// MUST have 2FA// MUST NOT have confirmation.- 'user-logged-in-2fa-no-activation' => [+ 'user-logged-in-2fa-no-activation' => [EncryptCookies::class,AddQueuedCookiesToResponse::class,StartSession::class,@@ -96,7 +96,7 @@ class Kernel extends HttpKernel// MUST be logged in// don't care about 2fa// don't care about confirmation.- 'user-simple-auth' => [+ 'user-simple-auth' => [EncryptCookies::class,AddQueuedCookiesToResponse::class,StartSession::class,@@ -109,7 +109,7 @@ class Kernel extends HttpKernel// MUST have 2fa// MUST be confirmed.// (this group includes the other Firefly middleware)- 'user-full-auth' => [+ 'user-full-auth' => [EncryptCookies::class,AddQueuedCookiesToResponse::class,StartSession::class,diff --git a/app/Http/routes.php b/app/Http/routes.phpindex 707e9d1664..caee07510f 100644--- a/app/Http/routes.php+++ b/app/Http/routes.php@@ -2,7 +2,6 @@declare(strict_types = 1);-/*** These routes only work when the user is NOT logged in.*/diff --git a/app/Models/Bill.php b/app/Models/Bill.phpindex 37cfdc5a6f..0742cc8e26 100644--- a/app/Models/Bill.php+++ b/app/Models/Bill.php@@ -28,7 +28,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;* @property \Carbon\Carbon $nextExpectedMatch* @property \Carbon\Carbon $lastFoundMatch* @property bool $paidInPeriod- * @property string $lastPaidAmount+ * @property string $lastPaidAmount* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereId($value)* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereCreatedAt($value)* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereUpdatedAt($value)@@ -51,7 +51,8 @@ class Bill extends Modelprotected $dates = ['created_at', 'updated_at', 'date'];protected $fillable- = ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',];+ = ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip',+ 'automatch', 'active',];protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted'];/**diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.phpindex 089bc3e88f..7c5bc3da07 100644--- a/app/Repositories/Bill/BillRepository.php+++ b/app/Repositories/Bill/BillRepository.php@@ -466,7 +466,7 @@ class BillRepository implements BillRepositoryInterface$description = strtolower($journal->description) . ' ' . strtolower(TransactionJournal::destinationAccount($journal)->name);// new: add source to word match:- $description .= ' '.strtolower(TransactionJournal::sourceAccount($journal)->name);+ $description .= ' ' . strtolower(TransactionJournal::sourceAccount($journal)->name);$wordMatch = $this->doWordMatch($matches, $description);$amountMatch = $this->doAmountMatch(TransactionJournal::amountPositive($journal), $bill->amount_min, $bill->amount_max);diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.phpindex 5cc51d0436..db638513f3 100644--- a/app/Validation/FireflyValidator.php+++ b/app/Validation/FireflyValidator.php@@ -60,7 +60,7 @@ class FireflyValidator extends Validatorreturn false;}- $secret = Session::get('two-factor-secret');+ $secret = Session::get('two-factor-secret');/** @var Google2FA $google2fa */$google2fa = app('PragmaRX\Google2FA\Google2FA');diff --git a/tests/TestCase.php b/tests/TestCase.phpindex 95dfdb28bb..6c0953cfab 100644--- a/tests/TestCase.php+++ b/tests/TestCase.php@@ -6,8 +6,6 @@ use FireflyIII\User;/*** Class TestCase*/--class TestCase extends Illuminate\Foundation\Testing\TestCase{/**@@ -39,8 +37,8 @@ class TestCase extends Illuminate\Foundation\Testing\TestCaseif ($range === 'custom') {$this->session([- 'start' => Carbon::now()->subDays(20),- 'end' => Carbon::now(),+ 'start' => Carbon::now()->subDays(20),+ 'end' => Carbon::now(),]);}