Some code cleanup.

This commit is contained in:
James Cole 2016-03-29 16:16:14 +02:00
parent 6fdfec3967
commit 08b5e66628
9 changed files with 16 additions and 19 deletions

View File

@ -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 = [

View File

@ -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;

View File

@ -41,8 +41,8 @@ class Controller extends BaseController
View::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));

View File

@ -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 HttpKernel
VerifyCsrfToken::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,

View File

@ -2,7 +2,6 @@
declare(strict_types = 1);
/**
* These routes only work when the user is NOT logged in.
*/

View File

@ -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 Model
protected $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'];
/**

View File

@ -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);

View File

@ -60,7 +60,7 @@ class FireflyValidator extends Validator
return false;
}
$secret = Session::get('two-factor-secret');
$secret = Session::get('two-factor-secret');
/** @var Google2FA $google2fa */
$google2fa = app('PragmaRX\Google2FA\Google2FA');

View File

@ -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\TestCase
if ($range === 'custom') {
$this->session(
[
'start' => Carbon::now()->subDays(20),
'end' => Carbon::now(),
'start' => Carbon::now()->subDays(20),
'end' => Carbon::now(),
]
);
}