Skip to content

Firefly III: a personal finances manager

Some spell checking [skip ci]

James Cole8ec804204553
diff --git a/app/controllers/BillController.php b/app/controllers/BillController.php
index e87b2602fd..de7e0f3545 100644
--- a/app/controllers/BillController.php
+++ b/app/controllers/BillController.php
@@ -118,7 +118,7 @@ class BillController extends BaseController
$hideBill = true;
- return View::make('bills.show', compact('journals', 'hideBills'))->with('bill', $bill)->with(
+ return View::make('bills.show', compact('journals', 'hideBill', 'bill'))->with(
'subTitle', $bill->name
);
}
diff --git a/app/controllers/HelpController.php b/app/controllers/HelpController.php
index 2ff4296b30..8d5f57155f 100644
--- a/app/controllers/HelpController.php
+++ b/app/controllers/HelpController.php
@@ -1,6 +1,8 @@
<?php
/**
+ * @SuppressWarnings("CyclomaticComplexity") // It's all 5. So ok.
+ *
* Class HelpController
*/
class HelpController extends BaseController
@@ -16,10 +18,9 @@ class HelpController extends BaseController
$helpTitle = 'Help';
if (!Route::has($route)) {
\Log::error('No such route: ' . $route);
+
return Response::json(['title' => $helpTitle, 'text' => $helpText]);
}
-
- // content in cache
if (Cache::has('help.' . $route . '.title') && Cache::has('help.' . $route . '.text')) {
$helpText = Cache::get('help.' . $route . '.text');
$helpTitle = Cache::get('help.' . $route . '.title');
@@ -30,19 +31,18 @@ class HelpController extends BaseController
$uri = 'https://raw.githubusercontent.com/JC5/firefly-iii-help/master/' . e($route) . '.md';
\Log::debug('URL is: ' . $uri);
try {
- $content = file_get_contents($uri);
+ $helpText = file_get_contents($uri);
} catch (ErrorException $e) {
- $content = '<p>There is no help for this route!</p>';
\Log::error(trim($e->getMessage()));
}
\Log::debug('Found help for ' . $route);
- \Log::debug('Help text length for route ' . $route . ' is ' . strlen($content));
- \Log::debug('Help text IS: "' . $content . '".');
- if (strlen(trim($content)) == 0) {
- $content = '<p>There is no help for this route.</p>';
+ \Log::debug('Help text length for route ' . $route . ' is ' . strlen($helpText));
+ \Log::debug('Help text IS: "' . $helpText . '".');
+ if (strlen(trim($helpText)) == 0) {
+ $helpText = '<p>There is no help for this route.</p>';
}
- $helpText = \Michelf\Markdown::defaultTransform($content);
+ $helpText = \Michelf\Markdown::defaultTransform($helpText);
$helpTitle = $route;
Cache::put('help.' . $route . '.text', $helpText, 10080); // a week.
diff --git a/app/controllers/PiggybankController.php b/app/controllers/PiggybankController.php
index d032c4fcfe..64e5917d41 100644
--- a/app/controllers/PiggybankController.php
+++ b/app/controllers/PiggybankController.php
@@ -239,6 +239,8 @@ class PiggyBankController extends BaseController
/**
* @param PiggyBank $piggyBank
*
+ * @SuppressWarnings("Unused")
+ *
* @return \Illuminate\View\View
*/
public function remove(PiggyBank $piggyBank)
@@ -326,7 +328,6 @@ class PiggyBankController extends BaseController
// always validate:
$messages = $this->_repository->validate($data);
- // flash messages:
Session::flash('warnings', $messages['warnings']);
Session::flash('successes', $messages['successes']);
Session::flash('errors', $messages['errors']);
diff --git a/app/controllers/RepeatedExpenseController.php b/app/controllers/RepeatedExpenseController.php
index a8e3d4dc73..695b5dbd7b 100644
--- a/app/controllers/RepeatedExpenseController.php
+++ b/app/controllers/RepeatedExpenseController.php
@@ -5,6 +5,10 @@ use FireflyIII\Database\PiggyBank\RepeatedExpense as Repository;
use FireflyIII\Exception\FireflyException;
/**
+ * @SuppressWarnings("CamelCase") // I'm fine with this.
+ * @SuppressWarnings("CyclomaticComplexity") // It's all 5. So ok.
+ * @SuppressWarnings("CouplingBetweenObjects") // There's only so much I can remove.
+ *
* Class RepeatedExpenseController
*/
class RepeatedExpenseController extends BaseController
@@ -28,11 +32,8 @@ class RepeatedExpenseController extends BaseController
public function create()
{
/** @var \FireflyIII\Database\Account\Account $acct */
- $acct = App::make('FireflyIII\Database\Account\Account');
-
- $periods = Config::get('firefly.piggy_bank_periods');
-
-
+ $acct = App::make('FireflyIII\Database\Account\Account');
+ $periods = Config::get('firefly.piggy_bank_periods');
$accounts = FFForm::makeSelectList($acct->getAssetAccounts());
return View::make('repeatedExpense.create', compact('accounts', 'periods'))->with('subTitle', 'Create new repeated expense')->with(
@@ -122,10 +123,10 @@ class RepeatedExpenseController extends BaseController
*/
public function show(PiggyBank $repeatedExpense)
{
- $subTitle = $repeatedExpense->name;
- $today = Carbon::now();
-
+ $subTitle = $repeatedExpense->name;
+ $today = Carbon::now();
$repetitions = $repeatedExpense->piggyBankRepetitions()->get();
+
$repetitions->each(
function (PiggyBankRepetition $repetition) {
$repetition->bars = $this->_repository->calculateParts($repetition);
@@ -154,7 +155,6 @@ class RepeatedExpenseController extends BaseController
// always validate:
$messages = $this->_repository->validate($data);
- // flash messages:
Session::flash('warnings', $messages['warnings']);
Session::flash('successes', $messages['successes']);
Session::flash('errors', $messages['errors']);
@@ -199,7 +199,6 @@ class RepeatedExpenseController extends BaseController
// always validate:
$messages = $this->_repository->validate($data);
- // flash messages:
Session::flash('warnings', $messages['warnings']);
Session::flash('successes', $messages['successes']);
Session::flash('errors', $messages['errors']);
diff --git a/app/controllers/ReportController.php b/app/controllers/ReportController.php
index 9dc5a15f6f..037b5e2627 100644
--- a/app/controllers/ReportController.php
+++ b/app/controllers/ReportController.php
@@ -4,6 +4,8 @@ use FireflyIII\Database\TransactionJournal\TransactionJournal as TransactionJour
use FireflyIII\Report\ReportInterface as Report;
/**
+ *
+ * @SuppressWarnings("CamelCase") // I'm fine with this.
*
* Class ReportController
*/
@@ -92,7 +94,7 @@ class ReportController extends BaseController
$budgets = $this->_repository->getBudgetsForMonth($date);
$categories = $this->_repository->getCategoriesForMonth($date, 10);
$accounts = $this->_repository->getAccountsForMonth($date);
- $piggyBanks = $this->_repository->getPiggyBanksForMonth($date);
+ //$piggyBanks = $this->_repository->getPiggyBanksForMonth($date);
return View::make(
'reports.month',
diff --git a/app/controllers/TransactionController.php b/app/controllers/TransactionController.php
index cd92e640a0..84da0e1cd7 100644
--- a/app/controllers/TransactionController.php
+++ b/app/controllers/TransactionController.php
@@ -7,6 +7,13 @@ use FireflyIII\Helper\TransactionJournal\HelperInterface as Helper;
use Illuminate\Support\Collection;
/**
+ *
+ * @SuppressWarnings("CamelCase") // I'm fine with this.
+ * @SuppressWarnings("CyclomaticComplexity") // It's all 5. So ok.
+ * @SuppressWarnings("CouplingBetweenObjects") // There's only so much I can remove.
+ * @SuppressWarnings("TooManyMethods") // I'm also fine with this.
+ * @SuppressWarnings("ExcessiveClassComplexity")
+ *
* Class TransactionController
*
*/
@@ -158,10 +165,10 @@ class TransactionController extends BaseController
*/
public function doRelate()
{
- $id = intval(Input::get('id'));
+ $brother = intval(Input::get('id'));
$sister = intval(Input::get('relateTo'));
- $journal = $this->_repository->find($id);
+ $journal = $this->_repository->find($brother);
$sis = $this->_repository->find($sister);
if ($journal && $sis) {
@@ -358,7 +365,6 @@ class TransactionController extends BaseController
// always validate:
$messages = $this->_repository->validate($data);
- // flash messages:
Session::flash('warnings', $messages['warnings']);
Session::flash('successes', $messages['successes']);
Session::flash('errors', $messages['errors']);
diff --git a/app/controllers/UserController.php b/app/controllers/UserController.php
index e1d3c29311..12d35e5d67 100644
--- a/app/controllers/UserController.php
+++ b/app/controllers/UserController.php
@@ -94,7 +94,7 @@ class UserController extends BaseController
*
* @return \Illuminate\View\View
*/
- public function postRemindme()
+ public function postRemindMe()
{
/** @var \FireflyIII\Database\User\User $repository */
@@ -108,7 +108,7 @@ class UserController extends BaseController
if (!$user) {
Session::flash('error', 'No good!');
- return View::make('user.remindme');
+ return View::make('user.remindMe');
}
$email->sendResetVerification($user);
@@ -132,9 +132,9 @@ class UserController extends BaseController
*
* @return \Illuminate\View\View
*/
- public function remindme()
+ public function remindMe()
{
- return View::make('user.remindme');
+ return View::make('user.remindMe');
}
/**
@@ -160,7 +160,7 @@ class UserController extends BaseController
return View::make('user.registered');
}
- return View::make('error')->with('message', 'Yo no hablo reset code!');
+ return View::make('error')->with('message', 'No reset code found!');
}
}
\ No newline at end of file
diff --git a/app/lib/FireflyIII/Collection/PiggybankPart.php b/app/lib/FireflyIII/Collection/PiggybankPart.php
index 17193d597b..906f4f21d8 100644
--- a/app/lib/FireflyIII/Collection/PiggybankPart.php
+++ b/app/lib/FireflyIII/Collection/PiggybankPart.php
@@ -115,7 +115,7 @@ class PiggyBankPart
{
if ($this->getCurrentamount() < $this->getCumulativeAmount()) {
$pct = 0;
- // calculate halway point?
+ // calculate halfway point?
if ($this->getCumulativeAmount() - $this->getCurrentamount() < $this->getAmountPerBar()) {
$left = $this->getCurrentamount() % $this->getAmountPerBar();
$pct = round($left / $this->getAmountPerBar() * 100);
diff --git a/app/lib/FireflyIII/Shared/Mail/Registration.php b/app/lib/FireflyIII/Shared/Mail/Registration.php
index 52747d561c..af771ff265 100644
--- a/app/lib/FireflyIII/Shared/Mail/Registration.php
+++ b/app/lib/FireflyIII/Shared/Mail/Registration.php
@@ -51,7 +51,7 @@ class Registration implements RegistrationInterface
$data = ['reset' => $reset];
try {
\Mail::send(
- ['emails.user.remindme-html', 'emails.user.remindme-text'], $data, function ($message) use ($email) {
+ ['emails.user.remindMe-html', 'emails.user.remindMe-text'], $data, function ($message) use ($email) {
$message->to($email, $email)->subject('Forgot your password?');
}
);
diff --git a/app/routes.php b/app/routes.php
index 5542d28aa1..ae34c5cb0a 100644
--- a/app/routes.php
+++ b/app/routes.php
@@ -368,7 +368,7 @@ Route::group(
Route::get('/login', ['uses' => 'UserController@login', 'as' => 'login']);
Route::get('/register', ['uses' => 'UserController@register', 'as' => 'register','before' => 'allow-register']);
Route::get('/reset/{reset}', ['uses' => 'UserController@reset', 'as' => 'reset']);
- Route::get('/remindme', ['uses' => 'UserController@remindme', 'as' => 'remindme']);
+ Route::get('/remindMe', ['uses' => 'UserController@remindMe', 'as' => 'remindMe']);
}
@@ -381,6 +381,6 @@ Route::group(
// user controller
Route::post('/login', ['uses' => 'UserController@postLogin', 'as' => 'login.post']);
Route::post('/register', ['uses' => 'UserController@postRegister', 'as' => 'register.post','before' => 'allow-register']);
- Route::post('/remindme', ['uses' => 'UserController@postRemindme', 'as' => 'remindme.post']);
+ Route::post('/remindMe', ['uses' => 'UserController@postRemindMe', 'as' => 'remindMe.post']);
}
);
\ No newline at end of file
diff --git a/app/views/user/login.blade.php b/app/views/user/login.blade.php
index c3b6efe898..4f7e8a678e 100644
--- a/app/views/user/login.blade.php
+++ b/app/views/user/login.blade.php
@@ -29,7 +29,7 @@
@if(Config::get('auth.allow_register') === true)
<a href="{{route('register')}}" class="btn btn-default">Register</a>
@endif
- <a href="{{route('remindme')}}" class="btn btn-default">Forgot your password?</a>
+ <a href="{{route('remindMe')}}" class="btn btn-default">Forgot your password?</a>
</div>
{{Form::close()}}
</div>
diff --git a/app/views/user/register.blade.php b/app/views/user/register.blade.php
index c4cb0fb74a..6fbc49a849 100644
--- a/app/views/user/register.blade.php
+++ b/app/views/user/register.blade.php
@@ -23,7 +23,7 @@
<div class="btn-group btn-group-justified btn-group-sm">
<a href="{{route('login')}}" class="btn btn-default">Back to the login form</a>
- <a href="{{route('remindme')}}" class="btn btn-default">Forgot your password?</a>
+ <a href="{{route('remindMe')}}" class="btn btn-default">Forgot your password?</a>
</div>
</div>
diff --git a/app/views/emails/user/remindme-html.blade.php b/app/views/user/remindMe-html.blade.php
similarity index 100%
rename from app/views/emails/user/remindme-html.blade.php
rename to app/views/user/remindMe-html.blade.php
diff --git a/app/views/emails/user/remindme-text.blade.php b/app/views/user/remindMe-text.blade.php
similarity index 100%
rename from app/views/emails/user/remindme-text.blade.php
rename to app/views/user/remindMe-text.blade.php
diff --git a/app/views/user/remindme.blade.php b/app/views/user/remindMe.blade.php
similarity index 95%
rename from app/views/user/remindme.blade.php
rename to app/views/user/remindMe.blade.php
index 252a765351..fcf0f179a3 100644
--- a/app/views/user/remindme.blade.php
+++ b/app/views/user/remindMe.blade.php
@@ -7,7 +7,7 @@
<h3 class="panel-title">Firefly III &mdash; Reset your password</h3>
</div>
<div class="panel-body">
- {{Form::open(['id' => 'remindme'])}}
+ {{Form::open(['id' => 'remindMe'])}}
<div class="form-group">
<label for="inputEmail">Email address</label>
<input type="email" class="form-control" id="inputEmail" name="email" placeholder="Enter email">
diff --git a/tests/functional/UserControllerCest.php b/tests/functional/UserControllerCest.php
index 53281b5536..7ee760c943 100644
--- a/tests/functional/UserControllerCest.php
+++ b/tests/functional/UserControllerCest.php
@@ -90,8 +90,8 @@ class UserControllerCest
public function postRemindme(FunctionalTester $I)
{
$I->wantTo('get a password reminder');
- $I->amOnRoute('remindme');
- $I->submitForm('#remindme', ['email' => '[email protected]']);
+ $I->amOnRoute('remindMe');
+ $I->submitForm('#remindMe', ['email' => '[email protected]']);
$I->see('You\'re about to get an e-mail.');
}
@@ -101,8 +101,8 @@ class UserControllerCest
public function postRemindmeFail(FunctionalTester $I)
{
$I->wantTo('get a password reminder and fail');
- $I->amOnRoute('remindme');
- $I->submitForm('#remindme', ['email' => 'abcdee']);
+ $I->amOnRoute('remindMe');
+ $I->submitForm('#remindMe', ['email' => 'abcdee']);
$I->see('No good!');
}
@@ -120,10 +120,10 @@ class UserControllerCest
/**
* @param FunctionalTester $I
*/
- public function remindme(FunctionalTester $I)
+ public function remindMe(FunctionalTester $I)
{
$I->wantTo('reminded of my password');
- $I->amOnRoute('remindme');
+ $I->amOnRoute('remindMe');
$I->see('Firefly III &mdash; Reset your password');
}