Some spell checking [skip ci]

This commit is contained in:
James Cole 2014-12-31 16:17:43 +01:00
parent cddc123539
commit 8ec8042045
16 changed files with 51 additions and 43 deletions

View File

@ -118,7 +118,7 @@ class BillController extends BaseController
$hideBill = true; $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 'subTitle', $bill->name
); );
} }

View File

@ -1,6 +1,8 @@
<?php <?php
/** /**
* @SuppressWarnings("CyclomaticComplexity") // It's all 5. So ok.
*
* Class HelpController * Class HelpController
*/ */
class HelpController extends BaseController class HelpController extends BaseController
@ -16,10 +18,9 @@ class HelpController extends BaseController
$helpTitle = 'Help'; $helpTitle = 'Help';
if (!Route::has($route)) { if (!Route::has($route)) {
\Log::error('No such route: ' . $route); \Log::error('No such route: ' . $route);
return Response::json(['title' => $helpTitle, 'text' => $helpText]); return Response::json(['title' => $helpTitle, 'text' => $helpText]);
} }
// content in cache
if (Cache::has('help.' . $route . '.title') && Cache::has('help.' . $route . '.text')) { if (Cache::has('help.' . $route . '.title') && Cache::has('help.' . $route . '.text')) {
$helpText = Cache::get('help.' . $route . '.text'); $helpText = Cache::get('help.' . $route . '.text');
$helpTitle = Cache::get('help.' . $route . '.title'); $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'; $uri = 'https://raw.githubusercontent.com/JC5/firefly-iii-help/master/' . e($route) . '.md';
\Log::debug('URL is: ' . $uri); \Log::debug('URL is: ' . $uri);
try { try {
$content = file_get_contents($uri); $helpText = file_get_contents($uri);
} catch (ErrorException $e) { } catch (ErrorException $e) {
$content = '<p>There is no help for this route!</p>';
\Log::error(trim($e->getMessage())); \Log::error(trim($e->getMessage()));
} }
\Log::debug('Found help for ' . $route); \Log::debug('Found help for ' . $route);
\Log::debug('Help text length for route ' . $route . ' is ' . strlen($content)); \Log::debug('Help text length for route ' . $route . ' is ' . strlen($helpText));
\Log::debug('Help text IS: "' . $content . '".'); \Log::debug('Help text IS: "' . $helpText . '".');
if (strlen(trim($content)) == 0) { if (strlen(trim($helpText)) == 0) {
$content = '<p>There is no help for this route.</p>'; $helpText = '<p>There is no help for this route.</p>';
} }
$helpText = \Michelf\Markdown::defaultTransform($content); $helpText = \Michelf\Markdown::defaultTransform($helpText);
$helpTitle = $route; $helpTitle = $route;
Cache::put('help.' . $route . '.text', $helpText, 10080); // a week. Cache::put('help.' . $route . '.text', $helpText, 10080); // a week.

View File

@ -239,6 +239,8 @@ class PiggyBankController extends BaseController
/** /**
* @param PiggyBank $piggyBank * @param PiggyBank $piggyBank
* *
* @SuppressWarnings("Unused")
*
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function remove(PiggyBank $piggyBank) public function remove(PiggyBank $piggyBank)
@ -326,7 +328,6 @@ class PiggyBankController extends BaseController
// always validate: // always validate:
$messages = $this->_repository->validate($data); $messages = $this->_repository->validate($data);
// flash messages:
Session::flash('warnings', $messages['warnings']); Session::flash('warnings', $messages['warnings']);
Session::flash('successes', $messages['successes']); Session::flash('successes', $messages['successes']);
Session::flash('errors', $messages['errors']); Session::flash('errors', $messages['errors']);

View File

@ -5,6 +5,10 @@ use FireflyIII\Database\PiggyBank\RepeatedExpense as Repository;
use FireflyIII\Exception\FireflyException; 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
*/ */
class RepeatedExpenseController extends BaseController class RepeatedExpenseController extends BaseController
@ -28,11 +32,8 @@ class RepeatedExpenseController extends BaseController
public function create() public function create()
{ {
/** @var \FireflyIII\Database\Account\Account $acct */ /** @var \FireflyIII\Database\Account\Account $acct */
$acct = App::make('FireflyIII\Database\Account\Account'); $acct = App::make('FireflyIII\Database\Account\Account');
$periods = Config::get('firefly.piggy_bank_periods');
$periods = Config::get('firefly.piggy_bank_periods');
$accounts = FFForm::makeSelectList($acct->getAssetAccounts()); $accounts = FFForm::makeSelectList($acct->getAssetAccounts());
return View::make('repeatedExpense.create', compact('accounts', 'periods'))->with('subTitle', 'Create new repeated expense')->with( 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) public function show(PiggyBank $repeatedExpense)
{ {
$subTitle = $repeatedExpense->name; $subTitle = $repeatedExpense->name;
$today = Carbon::now(); $today = Carbon::now();
$repetitions = $repeatedExpense->piggyBankRepetitions()->get(); $repetitions = $repeatedExpense->piggyBankRepetitions()->get();
$repetitions->each( $repetitions->each(
function (PiggyBankRepetition $repetition) { function (PiggyBankRepetition $repetition) {
$repetition->bars = $this->_repository->calculateParts($repetition); $repetition->bars = $this->_repository->calculateParts($repetition);
@ -154,7 +155,6 @@ class RepeatedExpenseController extends BaseController
// always validate: // always validate:
$messages = $this->_repository->validate($data); $messages = $this->_repository->validate($data);
// flash messages:
Session::flash('warnings', $messages['warnings']); Session::flash('warnings', $messages['warnings']);
Session::flash('successes', $messages['successes']); Session::flash('successes', $messages['successes']);
Session::flash('errors', $messages['errors']); Session::flash('errors', $messages['errors']);
@ -199,7 +199,6 @@ class RepeatedExpenseController extends BaseController
// always validate: // always validate:
$messages = $this->_repository->validate($data); $messages = $this->_repository->validate($data);
// flash messages:
Session::flash('warnings', $messages['warnings']); Session::flash('warnings', $messages['warnings']);
Session::flash('successes', $messages['successes']); Session::flash('successes', $messages['successes']);
Session::flash('errors', $messages['errors']); Session::flash('errors', $messages['errors']);

View File

@ -4,6 +4,8 @@ use FireflyIII\Database\TransactionJournal\TransactionJournal as TransactionJour
use FireflyIII\Report\ReportInterface as Report; use FireflyIII\Report\ReportInterface as Report;
/** /**
*
* @SuppressWarnings("CamelCase") // I'm fine with this.
* *
* Class ReportController * Class ReportController
*/ */
@ -92,7 +94,7 @@ class ReportController extends BaseController
$budgets = $this->_repository->getBudgetsForMonth($date); $budgets = $this->_repository->getBudgetsForMonth($date);
$categories = $this->_repository->getCategoriesForMonth($date, 10); $categories = $this->_repository->getCategoriesForMonth($date, 10);
$accounts = $this->_repository->getAccountsForMonth($date); $accounts = $this->_repository->getAccountsForMonth($date);
$piggyBanks = $this->_repository->getPiggyBanksForMonth($date); //$piggyBanks = $this->_repository->getPiggyBanksForMonth($date);
return View::make( return View::make(
'reports.month', 'reports.month',

View File

@ -7,6 +7,13 @@ use FireflyIII\Helper\TransactionJournal\HelperInterface as Helper;
use Illuminate\Support\Collection; 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 * Class TransactionController
* *
*/ */
@ -158,10 +165,10 @@ class TransactionController extends BaseController
*/ */
public function doRelate() public function doRelate()
{ {
$id = intval(Input::get('id')); $brother = intval(Input::get('id'));
$sister = intval(Input::get('relateTo')); $sister = intval(Input::get('relateTo'));
$journal = $this->_repository->find($id); $journal = $this->_repository->find($brother);
$sis = $this->_repository->find($sister); $sis = $this->_repository->find($sister);
if ($journal && $sis) { if ($journal && $sis) {
@ -358,7 +365,6 @@ class TransactionController extends BaseController
// always validate: // always validate:
$messages = $this->_repository->validate($data); $messages = $this->_repository->validate($data);
// flash messages:
Session::flash('warnings', $messages['warnings']); Session::flash('warnings', $messages['warnings']);
Session::flash('successes', $messages['successes']); Session::flash('successes', $messages['successes']);
Session::flash('errors', $messages['errors']); Session::flash('errors', $messages['errors']);

View File

@ -94,7 +94,7 @@ class UserController extends BaseController
* *
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function postRemindme() public function postRemindMe()
{ {
/** @var \FireflyIII\Database\User\User $repository */ /** @var \FireflyIII\Database\User\User $repository */
@ -108,7 +108,7 @@ class UserController extends BaseController
if (!$user) { if (!$user) {
Session::flash('error', 'No good!'); Session::flash('error', 'No good!');
return View::make('user.remindme'); return View::make('user.remindMe');
} }
$email->sendResetVerification($user); $email->sendResetVerification($user);
@ -132,9 +132,9 @@ class UserController extends BaseController
* *
* @return \Illuminate\View\View * @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('user.registered');
} }
return View::make('error')->with('message', 'Yo no hablo reset code!'); return View::make('error')->with('message', 'No reset code found!');
} }
} }

View File

@ -115,7 +115,7 @@ class PiggyBankPart
{ {
if ($this->getCurrentamount() < $this->getCumulativeAmount()) { if ($this->getCurrentamount() < $this->getCumulativeAmount()) {
$pct = 0; $pct = 0;
// calculate halway point? // calculate halfway point?
if ($this->getCumulativeAmount() - $this->getCurrentamount() < $this->getAmountPerBar()) { if ($this->getCumulativeAmount() - $this->getCurrentamount() < $this->getAmountPerBar()) {
$left = $this->getCurrentamount() % $this->getAmountPerBar(); $left = $this->getCurrentamount() % $this->getAmountPerBar();
$pct = round($left / $this->getAmountPerBar() * 100); $pct = round($left / $this->getAmountPerBar() * 100);

View File

@ -51,7 +51,7 @@ class Registration implements RegistrationInterface
$data = ['reset' => $reset]; $data = ['reset' => $reset];
try { try {
\Mail::send( \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?'); $message->to($email, $email)->subject('Forgot your password?');
} }
); );

View File

@ -368,7 +368,7 @@ Route::group(
Route::get('/login', ['uses' => 'UserController@login', 'as' => 'login']); Route::get('/login', ['uses' => 'UserController@login', 'as' => 'login']);
Route::get('/register', ['uses' => 'UserController@register', 'as' => 'register','before' => 'allow-register']); Route::get('/register', ['uses' => 'UserController@register', 'as' => 'register','before' => 'allow-register']);
Route::get('/reset/{reset}', ['uses' => 'UserController@reset', 'as' => 'reset']); 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 // user controller
Route::post('/login', ['uses' => 'UserController@postLogin', 'as' => 'login.post']); Route::post('/login', ['uses' => 'UserController@postLogin', 'as' => 'login.post']);
Route::post('/register', ['uses' => 'UserController@postRegister', 'as' => 'register.post','before' => 'allow-register']); 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']);
} }
); );

View File

@ -29,7 +29,7 @@
@if(Config::get('auth.allow_register') === true) @if(Config::get('auth.allow_register') === true)
<a href="{{route('register')}}" class="btn btn-default">Register</a> <a href="{{route('register')}}" class="btn btn-default">Register</a>
@endif @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> </div>
{{Form::close()}} {{Form::close()}}
</div> </div>

View File

@ -23,7 +23,7 @@
<div class="btn-group btn-group-justified btn-group-sm"> <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('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>
</div> </div>

View File

@ -7,7 +7,7 @@
<h3 class="panel-title">Firefly III &mdash; Reset your password</h3> <h3 class="panel-title">Firefly III &mdash; Reset your password</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
{{Form::open(['id' => 'remindme'])}} {{Form::open(['id' => 'remindMe'])}}
<div class="form-group"> <div class="form-group">
<label for="inputEmail">Email address</label> <label for="inputEmail">Email address</label>
<input type="email" class="form-control" id="inputEmail" name="email" placeholder="Enter email"> <input type="email" class="form-control" id="inputEmail" name="email" placeholder="Enter email">

View File

@ -90,8 +90,8 @@ class UserControllerCest
public function postRemindme(FunctionalTester $I) public function postRemindme(FunctionalTester $I)
{ {
$I->wantTo('get a password reminder'); $I->wantTo('get a password reminder');
$I->amOnRoute('remindme'); $I->amOnRoute('remindMe');
$I->submitForm('#remindme', ['email' => 'functional@example.com']); $I->submitForm('#remindMe', ['email' => 'functional@example.com']);
$I->see('You\'re about to get an e-mail.'); $I->see('You\'re about to get an e-mail.');
} }
@ -101,8 +101,8 @@ class UserControllerCest
public function postRemindmeFail(FunctionalTester $I) public function postRemindmeFail(FunctionalTester $I)
{ {
$I->wantTo('get a password reminder and fail'); $I->wantTo('get a password reminder and fail');
$I->amOnRoute('remindme'); $I->amOnRoute('remindMe');
$I->submitForm('#remindme', ['email' => 'abcdee']); $I->submitForm('#remindMe', ['email' => 'abcdee']);
$I->see('No good!'); $I->see('No good!');
} }
@ -120,10 +120,10 @@ class UserControllerCest
/** /**
* @param FunctionalTester $I * @param FunctionalTester $I
*/ */
public function remindme(FunctionalTester $I) public function remindMe(FunctionalTester $I)
{ {
$I->wantTo('reminded of my password'); $I->wantTo('reminded of my password');
$I->amOnRoute('remindme'); $I->amOnRoute('remindMe');
$I->see('Firefly III &mdash; Reset your password'); $I->see('Firefly III &mdash; Reset your password');
} }