Lots of cleanup and stuff.

This commit is contained in:
James Cole
2015-06-06 23:09:12 +02:00
parent 1a1f127993
commit 40b3097374
61 changed files with 361 additions and 323 deletions

View File

@@ -23,7 +23,7 @@ class BusServiceProvider extends ServiceProvider
public function boot(Dispatcher $dispatcher)
{
$dispatcher->mapUsing(
function($command) {
function ($command) {
return Dispatcher::simpleMapping(
$command, 'FireflyIII\Commands', 'FireflyIII\Handlers\Commands'
);

View File

@@ -52,15 +52,15 @@ class EventServiceProvider extends ServiceProvider
$this->registerDeleteEvents();
$this->registerCreateEvents();
BudgetLimit::saved(
function(BudgetLimit $budgetLimit) {
function (BudgetLimit $budgetLimit) {
Log::debug('Saved!');
$end = Navigation::addPeriod(clone $budgetLimit->startdate, $budgetLimit->repeat_freq, 0);
$end->subDay();
$set = $budgetLimit->limitrepetitions()
->where('startdate', $budgetLimit->startdate->format('Y-m-d 00:00:00'))
->where('enddate', $end->format('Y-m-d 00:00:00'))
->get();
->where('startdate', $budgetLimit->startdate->format('Y-m-d 00:00:00'))
->where('enddate', $end->format('Y-m-d 00:00:00'))
->get();
if ($set->count() == 0) {
$repetition = new LimitRepetition;
$repetition->startdate = $budgetLimit->startdate;
@@ -71,7 +71,7 @@ class EventServiceProvider extends ServiceProvider
try {
$repetition->save();
} catch (QueryException $e) {
Log::error('Trying to save new LimitRepetition failed: '.$e->getMessage()); // @codeCoverageIgnore
Log::error('Trying to save new LimitRepetition failed: ' . $e->getMessage()); // @codeCoverageIgnore
}
} else {
if ($set->count() == 1) {
@@ -93,7 +93,7 @@ class EventServiceProvider extends ServiceProvider
protected function registerDeleteEvents()
{
TransactionJournal::deleted(
function(TransactionJournal $journal) {
function (TransactionJournal $journal) {
/** @var Transaction $transaction */
foreach ($journal->transactions()->get() as $transaction) {
@@ -102,7 +102,7 @@ class EventServiceProvider extends ServiceProvider
}
);
PiggyBank::deleting(
function(PiggyBank $piggyBank) {
function (PiggyBank $piggyBank) {
$reminders = $piggyBank->reminders()->get();
/** @var Reminder $reminder */
foreach ($reminders as $reminder) {
@@ -112,7 +112,7 @@ class EventServiceProvider extends ServiceProvider
);
Account::deleted(
function(Account $account) {
function (Account $account) {
/** @var Transaction $transaction */
foreach ($account->transactions()->get() as $transaction) {
@@ -133,7 +133,7 @@ class EventServiceProvider extends ServiceProvider
// move this routine to a filter
// in case of repeated piggy banks and/or other problems.
PiggyBank::created(
function(PiggyBank $piggyBank) {
function (PiggyBank $piggyBank) {
$repetition = new PiggyBankRepetition;
$repetition->piggyBank()->associate($piggyBank);
$repetition->startdate = is_null($piggyBank->startdate) ? null : $piggyBank->startdate;

View File

@@ -30,7 +30,7 @@ class FireflyServiceProvider extends ServiceProvider
public function boot()
{
Validator::resolver(
function($translator, $data, $rules, $messages) {
function ($translator, $data, $rules, $messages) {
return new FireflyValidator($translator, $data, $rules, $messages);
}
);
@@ -55,28 +55,28 @@ class FireflyServiceProvider extends ServiceProvider
$this->app->bind(
'preferences', function() {
'preferences', function () {
return new Preferences;
}
);
$this->app->bind(
'navigation', function() {
'navigation', function () {
return new Navigation;
}
);
$this->app->bind(
'amount', function() {
'amount', function () {
return new Amount;
}
);
$this->app->bind(
'steam', function() {
'steam', function () {
return new Steam;
}
);
$this->app->bind(
'expandedform', function() {
'expandedform', function () {
return new ExpandedForm;
}
);

View File

@@ -44,7 +44,7 @@ class RouteServiceProvider extends ServiceProvider
public function map(Router $router)
{
$router->group(
['namespace' => $this->namespace], function($router) {
['namespace' => $this->namespace], function ($router) {
/** @noinspection PhpIncludeInspection */
require app_path('Http/routes.php');
}