Some cleaning up courtesy of PHPStorm.

This commit is contained in:
James Cole 2016-01-16 07:14:36 +01:00
parent 1b316e462e
commit e834489206
18 changed files with 51 additions and 37 deletions

View File

@ -156,7 +156,8 @@ class ChartJsBudgetChartGenerator implements BudgetChartGenerator
];
// get labels from one of the budgets (assuming there's at least one):
$first = $entries->first();
foreach ($first['budgeted'] as $year => $noInterest) {
$keys = array_keys($first['budgeted']);
foreach ($keys as $year) {
$data['labels'][] = strval($year);
}

View File

@ -124,7 +124,8 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
];
// get labels from one of the categories (assuming there's at least one):
$first = $entries->first();
foreach ($first['spent'] as $year => $noInterest) {
$keys = array_keys($first['spent']);
foreach ($keys as $year) {
$data['labels'][] = strval($year);
}

View File

@ -342,12 +342,6 @@ class ReportHelper implements ReportHelperInterface
*/
public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts)
{
// /** @var \FireflyIII\Repositories\Budget\BudgetRepositoryInterface $repository */
// $repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
// /** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */
// $tagRepository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface');
$balance = new Balance;
// build a balance header:

View File

@ -1,7 +1,6 @@
<?php namespace FireflyIII\Http\Controllers;
use Auth;
use FireflyIII\Http\Requests;
use FireflyIII\Http\Requests\DeleteAccountFormRequest;
use FireflyIII\Http\Requests\ProfileFormRequest;
use FireflyIII\User;

View File

@ -10,7 +10,6 @@
namespace FireflyIII\Http\Controllers;
use Auth;
use FireflyIII\Http\Requests;
use FireflyIII\Http\Requests\RuleFormRequest;
use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleAction;

View File

@ -293,7 +293,6 @@ class TransactionController extends Controller
*/
public function store(JournalFormRequest $request, JournalRepositoryInterface $repository, AttachmentHelperInterface $att)
{
$journalData = $request->getJournalData();
// if not withdrawal, unset budgetid.
@ -303,7 +302,6 @@ class TransactionController extends Controller
$journal = $repository->store($journalData);
// save attachments:
$att->saveAttachmentsForModel($journal);
// flash errors

View File

@ -540,8 +540,7 @@ class BillRepository implements BillRepositoryInterface
/** @var Account $creditCard */
foreach ($creditCards as $creditCard) {
if ($creditCard->balance == 0) {
// find a transfer TO the credit card which should account for
// anything paid. If not, the CC is not yet used.
// find a transfer TO the credit card which should account for anything paid. If not, the CC is not yet used.
$set = TransactionJournal::whereIn(
'transaction_journals.id', function (Builder $q) use ($creditCard, $start, $end) {
$q->select('transaction_journals.id')

View File

@ -10,7 +10,8 @@ use Illuminate\Support\Facades\Schema;
/**
* @SuppressWarnings(PHPMD.ShortMethodName) // method names are mandated by laravel.
* @SuppressWarnings("TooManyMethods") // I'm fine with this
* @SuppressWarnings(PHPMD.TooManyMethods)
*
*
* Down:
* 1. Create new Components based on Budgets.

View File

@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* Class ChangesForV3310
*/

View File

@ -4,6 +4,9 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class EntrustSetupTables
*
* @SuppressWarnings(PHPMD.ShortMethodName)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
class EntrustSetupTables extends Migration
{

View File

@ -5,6 +5,9 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV345
*
* @SuppressWarnings(PHPMD.ShortMethodName)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
class ChangesForV345 extends Migration
{

View File

@ -5,6 +5,8 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV3462
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
class ChangesForV3462 extends Migration
{

View File

@ -5,6 +5,8 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV349
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
class ChangesForV349 extends Migration
{

View File

@ -5,6 +5,8 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV3410
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
class ChangesForV3410 extends Migration
{

View File

@ -12,6 +12,9 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV370
*
* @SuppressWarnings(PHPMD.ShortMethodName)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
class ChangesForV370 extends Migration
{

View File

@ -23,6 +23,8 @@ use Illuminate\Database\Seeder;
/**
*
* Class TestDataSeeder
* @SuppressWarnings(PHPMD.ExcessiveClassLength)
* @SuppressWarnings(PHPMD.TooManyMethods)
*/
class TestDataSeeder extends Seeder
{
@ -39,6 +41,9 @@ class TestDataSeeder extends Seeder
}
/**
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function createRules()
{
// three rule groups to get started.
@ -433,26 +438,10 @@ class TestDataSeeder extends Seeder
$ruleAction->action_value = 'Bills';
$ruleAction->save();
unset($ruleAction);
// a normal rule: saves transactions where description contains "groceries"
// and from account is "MyBank Checking Account"
// send it to Groceries/Groceries
//$ruleAction
// TODO a rule that triggers on something, just like the previous one, but it has "stop_processing" set to 1.
// TODO a rule that triggers on that same thing, but it will not file, because the previous rule made FF skip it.
// TODO rule with specific actions.
// TODO rule with actions and one action has stop_processing and other actions are not processed. Somewhere in test?
}
/**
*
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function run()
{
@ -545,6 +534,9 @@ class TestDataSeeder extends Seeder
}
/**
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function createAssetAccounts()
{
$assets = ['MyBank Checking Account', 'Savings', 'Shared', 'Creditcard', 'Emergencies', 'STE'];
@ -663,6 +655,9 @@ class TestDataSeeder extends Seeder
);
}
/**
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function createPiggybanks()
{
$account = $this->findAccount('Savings');
@ -820,6 +815,8 @@ class TestDataSeeder extends Seeder
* @param Carbon $date
* @param $amount
*
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* @return TransactionJournal
*/
protected function createIncome($description, Carbon $date, $amount)
@ -1056,6 +1053,7 @@ class TestDataSeeder extends Seeder
/**
* @param Carbon $date
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function createGroceries(Carbon $date)
{
@ -1113,6 +1111,7 @@ class TestDataSeeder extends Seeder
/**
* @param Carbon $date
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function createDrinksAndOthers(Carbon $date)
{
@ -1331,6 +1330,12 @@ class TestDataSeeder extends Seeder
return null;
}
/**
* @param $date
*
* @return static
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function createCar($date)
{
// twice:

View File

@ -1,9 +1,8 @@
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
/**
* Class BasicTest
*/
class BasicTest extends TestCase
{
/**

View File

@ -1,5 +1,8 @@
<?php
/**
* Class TestCase
*/
class TestCase extends Illuminate\Foundation\Testing\TestCase
{
/**