mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some cleaning up courtesy of PHPStorm.
This commit is contained in:
parent
1b316e462e
commit
e834489206
@ -156,7 +156,8 @@ class ChartJsBudgetChartGenerator implements BudgetChartGenerator
|
|||||||
];
|
];
|
||||||
// get labels from one of the budgets (assuming there's at least one):
|
// get labels from one of the budgets (assuming there's at least one):
|
||||||
$first = $entries->first();
|
$first = $entries->first();
|
||||||
foreach ($first['budgeted'] as $year => $noInterest) {
|
$keys = array_keys($first['budgeted']);
|
||||||
|
foreach ($keys as $year) {
|
||||||
$data['labels'][] = strval($year);
|
$data['labels'][] = strval($year);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,8 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
|
|||||||
];
|
];
|
||||||
// get labels from one of the categories (assuming there's at least one):
|
// get labels from one of the categories (assuming there's at least one):
|
||||||
$first = $entries->first();
|
$first = $entries->first();
|
||||||
foreach ($first['spent'] as $year => $noInterest) {
|
$keys = array_keys($first['spent']);
|
||||||
|
foreach ($keys as $year) {
|
||||||
$data['labels'][] = strval($year);
|
$data['labels'][] = strval($year);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,12 +342,6 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
*/
|
*/
|
||||||
public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts)
|
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;
|
$balance = new Balance;
|
||||||
|
|
||||||
// build a balance header:
|
// build a balance header:
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers;
|
<?php namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use FireflyIII\Http\Requests;
|
|
||||||
use FireflyIII\Http\Requests\DeleteAccountFormRequest;
|
use FireflyIII\Http\Requests\DeleteAccountFormRequest;
|
||||||
use FireflyIII\Http\Requests\ProfileFormRequest;
|
use FireflyIII\Http\Requests\ProfileFormRequest;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
namespace FireflyIII\Http\Controllers;
|
namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use FireflyIII\Http\Requests;
|
|
||||||
use FireflyIII\Http\Requests\RuleFormRequest;
|
use FireflyIII\Http\Requests\RuleFormRequest;
|
||||||
use FireflyIII\Models\Rule;
|
use FireflyIII\Models\Rule;
|
||||||
use FireflyIII\Models\RuleAction;
|
use FireflyIII\Models\RuleAction;
|
||||||
|
@ -293,7 +293,6 @@ class TransactionController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function store(JournalFormRequest $request, JournalRepositoryInterface $repository, AttachmentHelperInterface $att)
|
public function store(JournalFormRequest $request, JournalRepositoryInterface $repository, AttachmentHelperInterface $att)
|
||||||
{
|
{
|
||||||
|
|
||||||
$journalData = $request->getJournalData();
|
$journalData = $request->getJournalData();
|
||||||
|
|
||||||
// if not withdrawal, unset budgetid.
|
// if not withdrawal, unset budgetid.
|
||||||
@ -303,7 +302,6 @@ class TransactionController extends Controller
|
|||||||
|
|
||||||
$journal = $repository->store($journalData);
|
$journal = $repository->store($journalData);
|
||||||
|
|
||||||
// save attachments:
|
|
||||||
$att->saveAttachmentsForModel($journal);
|
$att->saveAttachmentsForModel($journal);
|
||||||
|
|
||||||
// flash errors
|
// flash errors
|
||||||
|
@ -540,8 +540,7 @@ class BillRepository implements BillRepositoryInterface
|
|||||||
/** @var Account $creditCard */
|
/** @var Account $creditCard */
|
||||||
foreach ($creditCards as $creditCard) {
|
foreach ($creditCards as $creditCard) {
|
||||||
if ($creditCard->balance == 0) {
|
if ($creditCard->balance == 0) {
|
||||||
// find a transfer TO the credit card which should account for
|
// find a transfer TO the credit card which should account for anything paid. If not, the CC is not yet used.
|
||||||
// anything paid. If not, the CC is not yet used.
|
|
||||||
$set = TransactionJournal::whereIn(
|
$set = TransactionJournal::whereIn(
|
||||||
'transaction_journals.id', function (Builder $q) use ($creditCard, $start, $end) {
|
'transaction_journals.id', function (Builder $q) use ($creditCard, $start, $end) {
|
||||||
$q->select('transaction_journals.id')
|
$q->select('transaction_journals.id')
|
||||||
|
@ -10,7 +10,8 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName) // method names are mandated by laravel.
|
* @SuppressWarnings(PHPMD.ShortMethodName) // method names are mandated by laravel.
|
||||||
* @SuppressWarnings("TooManyMethods") // I'm fine with this
|
* @SuppressWarnings(PHPMD.TooManyMethods)
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* Down:
|
* Down:
|
||||||
* 1. Create new Components based on Budgets.
|
* 1. Create new Components based on Budgets.
|
||||||
|
@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
*
|
*
|
||||||
* Class ChangesForV3310
|
* Class ChangesForV3310
|
||||||
*/
|
*/
|
||||||
|
@ -4,6 +4,9 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class EntrustSetupTables
|
* Class EntrustSetupTables
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
*/
|
*/
|
||||||
class EntrustSetupTables extends Migration
|
class EntrustSetupTables extends Migration
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,9 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ChangesForV345
|
* Class ChangesForV345
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
*/
|
*/
|
||||||
class ChangesForV345 extends Migration
|
class ChangesForV345 extends Migration
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,8 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ChangesForV3462
|
* Class ChangesForV3462
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*/
|
*/
|
||||||
class ChangesForV3462 extends Migration
|
class ChangesForV3462 extends Migration
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,8 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ChangesForV349
|
* Class ChangesForV349
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*/
|
*/
|
||||||
class ChangesForV349 extends Migration
|
class ChangesForV349 extends Migration
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,8 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ChangesForV3410
|
* Class ChangesForV3410
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*/
|
*/
|
||||||
class ChangesForV3410 extends Migration
|
class ChangesForV3410 extends Migration
|
||||||
{
|
{
|
||||||
|
@ -12,6 +12,9 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ChangesForV370
|
* Class ChangesForV370
|
||||||
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
*/
|
*/
|
||||||
class ChangesForV370 extends Migration
|
class ChangesForV370 extends Migration
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,8 @@ use Illuminate\Database\Seeder;
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Class TestDataSeeder
|
* Class TestDataSeeder
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveClassLength)
|
||||||
|
* @SuppressWarnings(PHPMD.TooManyMethods)
|
||||||
*/
|
*/
|
||||||
class TestDataSeeder extends Seeder
|
class TestDataSeeder extends Seeder
|
||||||
{
|
{
|
||||||
@ -39,6 +41,9 @@ class TestDataSeeder extends Seeder
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
|
*/
|
||||||
public function createRules()
|
public function createRules()
|
||||||
{
|
{
|
||||||
// three rule groups to get started.
|
// three rule groups to get started.
|
||||||
@ -433,26 +438,10 @@ class TestDataSeeder extends Seeder
|
|||||||
$ruleAction->action_value = 'Bills';
|
$ruleAction->action_value = 'Bills';
|
||||||
$ruleAction->save();
|
$ruleAction->save();
|
||||||
unset($ruleAction);
|
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()
|
public function run()
|
||||||
{
|
{
|
||||||
@ -545,6 +534,9 @@ class TestDataSeeder extends Seeder
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
|
*/
|
||||||
protected function createAssetAccounts()
|
protected function createAssetAccounts()
|
||||||
{
|
{
|
||||||
$assets = ['MyBank Checking Account', 'Savings', 'Shared', 'Creditcard', 'Emergencies', 'STE'];
|
$assets = ['MyBank Checking Account', 'Savings', 'Shared', 'Creditcard', 'Emergencies', 'STE'];
|
||||||
@ -663,6 +655,9 @@ class TestDataSeeder extends Seeder
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
|
*/
|
||||||
protected function createPiggybanks()
|
protected function createPiggybanks()
|
||||||
{
|
{
|
||||||
$account = $this->findAccount('Savings');
|
$account = $this->findAccount('Savings');
|
||||||
@ -820,6 +815,8 @@ class TestDataSeeder extends Seeder
|
|||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
* @param $amount
|
* @param $amount
|
||||||
*
|
*
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
|
*
|
||||||
* @return TransactionJournal
|
* @return TransactionJournal
|
||||||
*/
|
*/
|
||||||
protected function createIncome($description, Carbon $date, $amount)
|
protected function createIncome($description, Carbon $date, $amount)
|
||||||
@ -1056,6 +1053,7 @@ class TestDataSeeder extends Seeder
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
*/
|
*/
|
||||||
protected function createGroceries(Carbon $date)
|
protected function createGroceries(Carbon $date)
|
||||||
{
|
{
|
||||||
@ -1113,6 +1111,7 @@ class TestDataSeeder extends Seeder
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
*/
|
*/
|
||||||
protected function createDrinksAndOthers(Carbon $date)
|
protected function createDrinksAndOthers(Carbon $date)
|
||||||
{
|
{
|
||||||
@ -1331,6 +1330,12 @@ class TestDataSeeder extends Seeder
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $date
|
||||||
|
*
|
||||||
|
* @return static
|
||||||
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||||
|
*/
|
||||||
protected function createCar($date)
|
protected function createCar($date)
|
||||||
{
|
{
|
||||||
// twice:
|
// twice:
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
/**
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
* Class BasicTest
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
*/
|
||||||
|
|
||||||
class BasicTest extends TestCase
|
class BasicTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class TestCase
|
||||||
|
*/
|
||||||
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user