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

View File

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

View File

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

View File

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

View File

@ -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',

View File

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

View File

@ -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!');
}
}

View File

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

View File

@ -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?');
}
);

View File

@ -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']);
}
);

View File

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

View File

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

View File

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

View File

@ -90,8 +90,8 @@ class UserControllerCest
public function postRemindme(FunctionalTester $I)
{
$I->wantTo('get a password reminder');
$I->amOnRoute('remindme');
$I->submitForm('#remindme', ['email' => 'functional@example.com']);
$I->amOnRoute('remindMe');
$I->submitForm('#remindMe', ['email' => 'functional@example.com']);
$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');
}