Add code coverage ignore instructions.

This commit is contained in:
James Cole
2017-03-04 11:19:44 +01:00
parent 45f4395f26
commit 9d22bbee1c
25 changed files with 64 additions and 63 deletions

View File

@@ -411,7 +411,7 @@ class AccountController extends Controller
if ($cache->has()) { if ($cache->has()) {
Log::debug('Entries are cached, return cache.'); Log::debug('Entries are cached, return cache.');
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
// only include asset accounts when this account is an asset: // only include asset accounts when this account is an asset:

View File

@@ -423,7 +423,7 @@ class BudgetController extends Controller
$cache->addProperty('get-limits'); $cache->addProperty('get-limits');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
/** @var AccountRepositoryInterface $accountRepository */ /** @var AccountRepositoryInterface $accountRepository */

View File

@@ -339,7 +339,7 @@ class CategoryController extends Controller
$cache->addProperty($category->id); $cache->addProperty($category->id);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
while ($end >= $first) { while ($end >= $first) {
$end = Navigation::startOfPeriod($end, $range); $end = Navigation::startOfPeriod($end, $range);

View File

@@ -67,7 +67,7 @@ class AccountController extends Controller
if ($cache->has()) { if ($cache->has()) {
Log::debug('Return chart.account.all from cache.'); Log::debug('Return chart.account.all from cache.');
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
Log::debug('Regenerate chart.account.all from scratch.'); Log::debug('Regenerate chart.account.all from scratch.');
@@ -112,7 +112,7 @@ class AccountController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('chart.account.expense-accounts'); $cache->addProperty('chart.account.expense-accounts');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$start->subDay(); $start->subDay();
@@ -153,7 +153,7 @@ class AccountController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('chart.account.expense-budget'); $cache->addProperty('chart.account.expense-budget');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$collector = app(JournalCollectorInterface::class); $collector = app(JournalCollectorInterface::class);
$collector->setAccounts(new Collection([$account]))->setRange($start, $end)->withBudgetInformation()->setTypes([TransactionType::WITHDRAWAL]); $collector->setAccounts(new Collection([$account]))->setRange($start, $end)->withBudgetInformation()->setTypes([TransactionType::WITHDRAWAL]);
@@ -210,7 +210,7 @@ class AccountController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('chart.account.expense-category'); $cache->addProperty('chart.account.expense-category');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$collector = app(JournalCollectorInterface::class); $collector = app(JournalCollectorInterface::class);
@@ -293,7 +293,7 @@ class AccountController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('chart.account.income-category'); $cache->addProperty('chart.account.income-category');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
// grab all journals: // grab all journals:
@@ -359,7 +359,7 @@ class AccountController extends Controller
$cache->addProperty('chart.account.period'); $cache->addProperty('chart.account.period');
$cache->addProperty($account->id); $cache->addProperty($account->id);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$format = (string)trans('config.month_and_day'); $format = (string)trans('config.month_and_day');
@@ -414,7 +414,7 @@ class AccountController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('chart.account.revenue-accounts'); $cache->addProperty('chart.account.revenue-accounts');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$accounts = $repository->getAccountsByType([AccountType::REVENUE]); $accounts = $repository->getAccountsByType([AccountType::REVENUE]);
@@ -460,7 +460,7 @@ class AccountController extends Controller
$cache->addProperty('chart.account.single'); $cache->addProperty('chart.account.single');
$cache->addProperty($account->id); $cache->addProperty($account->id);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$format = (string)trans('config.month_and_day'); $format = (string)trans('config.month_and_day');
@@ -502,7 +502,7 @@ class AccountController extends Controller
if ($cache->has()) { if ($cache->has()) {
Log::debug('Return chart.account.account-balance-chart from cache.'); Log::debug('Return chart.account.account-balance-chart from cache.');
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
Log::debug('Regenerate chart.account.account-balance-chart from scratch.'); Log::debug('Regenerate chart.account.account-balance-chart from scratch.');

View File

@@ -60,7 +60,7 @@ class BillController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('chart.bill.frontpage'); $cache->addProperty('chart.bill.frontpage');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$paid = $repository->getBillsPaidInRange($start, $end); // will be a negative amount. $paid = $repository->getBillsPaidInRange($start, $end); // will be a negative amount.
@@ -88,7 +88,7 @@ class BillController extends Controller
$cache->addProperty('chart.bill.single'); $cache->addProperty('chart.bill.single');
$cache->addProperty($bill->id); $cache->addProperty($bill->id);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$results = $collector->setAllAssetAccounts()->setBills(new Collection([$bill]))->getJournals(); $results = $collector->setAllAssetAccounts()->setBills(new Collection([$bill]))->getJournals();

View File

@@ -80,7 +80,7 @@ class BudgetController extends Controller
$cache->addProperty('chart.budget.budget'); $cache->addProperty('chart.budget.budget');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$final = clone $last; $final = clone $last;
@@ -133,7 +133,7 @@ class BudgetController extends Controller
$cache->addProperty($budgetLimit->id); $cache->addProperty($budgetLimit->id);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$entries = []; $entries = [];
@@ -170,7 +170,7 @@ class BudgetController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('chart.budget.frontpage'); $cache->addProperty('chart.budget.frontpage');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$budgets = $this->repository->getActiveBudgets(); $budgets = $this->repository->getActiveBudgets();
$chartData = [ $chartData = [
@@ -227,7 +227,7 @@ class BudgetController extends Controller
$cache->addProperty($budget->id); $cache->addProperty($budget->id);
$cache->addProperty('chart.budget.period'); $cache->addProperty('chart.budget.period');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$periods = Navigation::listOfPeriods($start, $end); $periods = Navigation::listOfPeriods($start, $end);
$entries = $this->repository->getBudgetPeriodReport(new Collection([$budget]), $accounts, $start, $end); // get the expenses $entries = $this->repository->getBudgetPeriodReport(new Collection([$budget]), $accounts, $start, $end); // get the expenses
@@ -268,7 +268,7 @@ class BudgetController extends Controller
$cache->addProperty($accounts); $cache->addProperty($accounts);
$cache->addProperty('chart.budget.no-budget'); $cache->addProperty('chart.budget.no-budget');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
// the expenses: // the expenses:

View File

@@ -131,7 +131,7 @@ class BudgetReportController extends Controller
$cache->addProperty($start); $cache->addProperty($start);
$cache->addProperty($end); $cache->addProperty($end);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
/** @var BudgetRepositoryInterface $repository */ /** @var BudgetRepositoryInterface $repository */
$repository = app(BudgetRepositoryInterface::class); $repository = app(BudgetRepositoryInterface::class);

View File

@@ -62,7 +62,7 @@ class CategoryController extends Controller
$cache->addProperty('chart.category.all'); $cache->addProperty('chart.category.all');
$cache->addProperty($category->id); $cache->addProperty($category->id);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$start = $repository->firstUseDate($category); $start = $repository->firstUseDate($category);
@@ -136,7 +136,7 @@ class CategoryController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('chart.category.frontpage'); $cache->addProperty('chart.category.frontpage');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$chartData = []; $chartData = [];
$categories = $repository->getCategories(); $categories = $repository->getCategories();
@@ -178,7 +178,7 @@ class CategoryController extends Controller
$cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($accounts->pluck('id')->toArray());
$cache->addProperty($category); $cache->addProperty($category);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$expenses = $repository->periodExpenses(new Collection([$category]), $accounts, $start, $end); $expenses = $repository->periodExpenses(new Collection([$category]), $accounts, $start, $end);
$income = $repository->periodIncome(new Collection([$category]), $accounts, $start, $end); $income = $repository->periodIncome(new Collection([$category]), $accounts, $start, $end);
@@ -225,7 +225,7 @@ class CategoryController extends Controller
$cache->addProperty('chart.category.period.no-cat'); $cache->addProperty('chart.category.period.no-cat');
$cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$expenses = $repository->periodExpensesNoCategory($accounts, $start, $end); $expenses = $repository->periodExpensesNoCategory($accounts, $start, $end);
$income = $repository->periodIncomeNoCategory($accounts, $start, $end); $income = $repository->periodIncomeNoCategory($accounts, $start, $end);
@@ -297,7 +297,7 @@ class CategoryController extends Controller
$accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
// chart data // chart data

View File

@@ -179,7 +179,7 @@ class CategoryReportController extends Controller
$cache->addProperty($start); $cache->addProperty($start);
$cache->addProperty($end); $cache->addProperty($end);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$format = Navigation::preferredCarbonLocalizedFormat($start, $end); $format = Navigation::preferredCarbonLocalizedFormat($start, $end);

View File

@@ -58,7 +58,7 @@ class PiggyBankController extends Controller
$cache->addProperty('chart.piggy-bank.history'); $cache->addProperty('chart.piggy-bank.history');
$cache->addProperty($piggyBank->id); $cache->addProperty($piggyBank->id);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$set = $repository->getEvents($piggyBank); $set = $repository->getEvents($piggyBank);

View File

@@ -64,7 +64,7 @@ class ReportController extends Controller
$cache->addProperty($accounts); $cache->addProperty($accounts);
$cache->addProperty($end); $cache->addProperty($end);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$ids = $accounts->pluck('id')->toArray(); $ids = $accounts->pluck('id')->toArray();
$current = clone $start; $current = clone $start;
@@ -103,7 +103,7 @@ class ReportController extends Controller
$cache->addProperty($accounts); $cache->addProperty($accounts);
$cache->addProperty($end); $cache->addProperty($end);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$format = Navigation::preferredCarbonLocalizedFormat($start, $end); $format = Navigation::preferredCarbonLocalizedFormat($start, $end);
$source = $this->getChartData($accounts, $start, $end); $source = $this->getChartData($accounts, $start, $end);
@@ -161,7 +161,7 @@ class ReportController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty($accounts); $cache->addProperty($accounts);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$source = $this->getChartData($accounts, $start, $end); $source = $this->getChartData($accounts, $start, $end);
$numbers = [ $numbers = [
@@ -246,7 +246,7 @@ class ReportController extends Controller
$cache->addProperty($accounts); $cache->addProperty($accounts);
$cache->addProperty($end); $cache->addProperty($end);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }

View File

@@ -152,7 +152,7 @@ class TagReportController extends Controller
$cache->addProperty($start); $cache->addProperty($start);
$cache->addProperty($end); $cache->addProperty($end);
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$format = Navigation::preferredCarbonLocalizedFormat($start, $end); $format = Navigation::preferredCarbonLocalizedFormat($start, $end);

View File

@@ -155,7 +155,7 @@ class JsonController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('box-in'); $cache->addProperty('box-in');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]); $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]);
$assets = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $assets = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
@@ -183,7 +183,7 @@ class JsonController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty('box-out'); $cache->addProperty('box-out');
if ($cache->has()) { if ($cache->has()) {
return Response::json($cache->get()); return Response::json($cache->get()); // @codeCoverageIgnore
} }
$accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]); $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]);

View File

@@ -44,7 +44,7 @@ class AccountController extends Controller
$cache->addProperty('account-report'); $cache->addProperty('account-report');
$cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
/** @var AccountTaskerInterface $accountTasker */ /** @var AccountTaskerInterface $accountTasker */

View File

@@ -47,7 +47,7 @@ class BalanceController extends Controller
$cache->addProperty('balance-report'); $cache->addProperty('balance-report');
$cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$balance = $helper->getBalanceReport($accounts, $start, $end); $balance = $helper->getBalanceReport($accounts, $start, $end);

View File

@@ -49,7 +49,7 @@ class BudgetController extends Controller
$cache->addProperty('budget-report'); $cache->addProperty('budget-report');
$cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$budgets = $helper->getBudgetReport($start, $end, $accounts); $budgets = $helper->getBudgetReport($start, $end, $accounts);
@@ -76,7 +76,7 @@ class BudgetController extends Controller
$cache->addProperty('budget-period-report'); $cache->addProperty('budget-period-report');
$cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
// generate budget report right here. // generate budget report right here.

View File

@@ -47,7 +47,7 @@ class CategoryController extends Controller
if ($cache->has()) { if ($cache->has()) {
Log::debug('Return report from cache'); Log::debug('Return report from cache');
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
/** @var CategoryRepositoryInterface $repository */ /** @var CategoryRepositoryInterface $repository */
$repository = app(CategoryRepositoryInterface::class); $repository = app(CategoryRepositoryInterface::class);
@@ -81,7 +81,7 @@ class CategoryController extends Controller
if ($cache->has()) { if ($cache->has()) {
Log::debug('Return report from cache'); Log::debug('Return report from cache');
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
/** @var CategoryRepositoryInterface $repository */ /** @var CategoryRepositoryInterface $repository */
$repository = app(CategoryRepositoryInterface::class); $repository = app(CategoryRepositoryInterface::class);
@@ -114,7 +114,7 @@ class CategoryController extends Controller
$cache->addProperty('category-report'); $cache->addProperty('category-report');
$cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
/** @var CategoryRepositoryInterface $repository */ /** @var CategoryRepositoryInterface $repository */

View File

@@ -46,7 +46,7 @@ class OperationsController extends Controller
$cache->addProperty('expense-report'); $cache->addProperty('expense-report');
$cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$entries = $this->getExpenseReport($start, $end, $accounts); $entries = $this->getExpenseReport($start, $end, $accounts);
$type = 'expense-entry'; $type = 'expense-entry';
@@ -73,7 +73,7 @@ class OperationsController extends Controller
$cache->addProperty('income-report'); $cache->addProperty('income-report');
$cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$entries = $this->getIncomeReport($start, $end, $accounts); $entries = $this->getIncomeReport($start, $end, $accounts);
$type = 'income-entry'; $type = 'income-entry';
@@ -101,7 +101,7 @@ class OperationsController extends Controller
$cache->addProperty('inc-exp-report'); $cache->addProperty('inc-exp-report');
$cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$incomes = $this->getIncomeReport($start, $end, $accounts); $incomes = $this->getIncomeReport($start, $end, $accounts);

View File

@@ -386,7 +386,7 @@ class TagController extends Controller
$cache->addProperty($tag->id); $cache->addProperty($tag->id);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$collection = new Collection; $collection = new Collection;

View File

@@ -119,20 +119,20 @@ class ConvertController extends Controller
*/ */
public function postIndex(Request $request, JournalRepositoryInterface $repository, TransactionType $destinationType, TransactionJournal $journal) public function postIndex(Request $request, JournalRepositoryInterface $repository, TransactionType $destinationType, TransactionJournal $journal)
{ {
// @codeCoverageIgnoreStart
if ($this->isOpeningBalance($journal)) { if ($this->isOpeningBalance($journal)) {
return $this->redirectToAccount($journal); return $this->redirectToAccount($journal);
} }
// @codeCoverageIgnoreEnd
$data = $request->all(); $data = $request->all();
// cannot convert to its own type.
if ($journal->transactionType->type === $destinationType->type) { if ($journal->transactionType->type === $destinationType->type) {
Session::flash('error', trans('firefly.convert_is_already_type_' . $destinationType->type)); Session::flash('error', trans('firefly.convert_is_already_type_' . $destinationType->type));
return redirect(route('transactions.show', [$journal->id])); return redirect(route('transactions.show', [$journal->id]));
} }
// cannot convert split.
if ($journal->transactions()->count() > 2) { if ($journal->transactions()->count() > 2) {
Session::flash('error', trans('firefly.cannot_convert_split_journl')); Session::flash('error', trans('firefly.cannot_convert_split_journl'));
@@ -173,7 +173,8 @@ class ConvertController extends Controller
$joined = $sourceType->type . '-' . $destinationType->type; $joined = $sourceType->type . '-' . $destinationType->type;
switch ($joined) { switch ($joined) {
default: default:
throw new FireflyException('Cannot handle ' . $joined);
throw new FireflyException('Cannot handle ' . $joined); // @codeCoverageIgnore
case TransactionType::WITHDRAWAL . '-' . TransactionType::DEPOSIT: // one case TransactionType::WITHDRAWAL . '-' . TransactionType::DEPOSIT: // one
$destination = $sourceAccount; $destination = $sourceAccount;
break; break;
@@ -218,7 +219,7 @@ class ConvertController extends Controller
$joined = $sourceType->type . '-' . $destinationType->type; $joined = $sourceType->type . '-' . $destinationType->type;
switch ($joined) { switch ($joined) {
default: default:
throw new FireflyException('Cannot handle ' . $joined); throw new FireflyException('Cannot handle ' . $joined); // @codeCoverageIgnore
case TransactionType::WITHDRAWAL . '-' . TransactionType::DEPOSIT: // one case TransactionType::WITHDRAWAL . '-' . TransactionType::DEPOSIT: // one
case TransactionType::TRANSFER . '-' . TransactionType::DEPOSIT: // six case TransactionType::TRANSFER . '-' . TransactionType::DEPOSIT: // six
$data = [ $data = [

View File

@@ -170,7 +170,7 @@ class TransactionJournal extends Model
$cache->addProperty($name); $cache->addProperty($name);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
Log::debug(sprintf('Looking for journal #%d meta field "%s".', $this->id, $name)); Log::debug(sprintf('Looking for journal #%d meta field "%s".', $this->id, $name));

View File

@@ -396,7 +396,7 @@ class BillRepository implements BillRepositoryInterface
$cache->addProperty('nextDateMatch'); $cache->addProperty('nextDateMatch');
$cache->addProperty($date); $cache->addProperty($date);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
// find the most recent date for this bill NOT in the future. Cache this date: // find the most recent date for this bill NOT in the future. Cache this date:
$start = clone $bill->date; $start = clone $bill->date;
@@ -433,7 +433,7 @@ class BillRepository implements BillRepositoryInterface
$cache->addProperty('nextExpectedMatch'); $cache->addProperty('nextExpectedMatch');
$cache->addProperty($date); $cache->addProperty($date);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
// find the most recent date for this bill NOT in the future. Cache this date: // find the most recent date for this bill NOT in the future. Cache this date:
$start = clone $bill->date; $start = clone $bill->date;

View File

@@ -220,7 +220,7 @@ class Amount
$cache = new CacheProperties; $cache = new CacheProperties;
$cache->addProperty('getCurrencyCode'); $cache->addProperty('getCurrencyCode');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} else { } else {
$currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR')); $currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR'));
@@ -245,7 +245,7 @@ class Amount
$cache = new CacheProperties; $cache = new CacheProperties;
$cache->addProperty('getCurrencySymbol'); $cache->addProperty('getCurrencySymbol');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} else { } else {
$currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR')); $currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR'));
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first(); $currency = TransactionCurrency::whereCode($currencyPreference->data)->first();
@@ -264,7 +264,7 @@ class Amount
$cache = new CacheProperties; $cache = new CacheProperties;
$cache->addProperty('getDefaultCurrency'); $cache->addProperty('getDefaultCurrency');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR')); $currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR'));
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first(); $currency = TransactionCurrency::whereCode($currencyPreference->data)->first();

View File

@@ -43,7 +43,7 @@ class Steam
$cache->addProperty('balance'); $cache->addProperty('balance');
$cache->addProperty($date); $cache->addProperty($date);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$balance = strval( $balance = strval(
@@ -74,7 +74,7 @@ class Steam
$cache->addProperty('balance-no-virtual'); $cache->addProperty('balance-no-virtual');
$cache->addProperty($date); $cache->addProperty($date);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$balance = strval( $balance = strval(
@@ -108,7 +108,7 @@ class Steam
$cache->addProperty($start); $cache->addProperty($start);
$cache->addProperty($end); $cache->addProperty($end);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$balances = []; $balances = [];
@@ -158,7 +158,7 @@ class Steam
$cache->addProperty('balances'); $cache->addProperty('balances');
$cache->addProperty($date); $cache->addProperty($date);
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$balances = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') $balances = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')

View File

@@ -44,7 +44,7 @@ class Journal extends Twig_Extension
$cache->addProperty('transaction-journal'); $cache->addProperty('transaction-journal');
$cache->addProperty('destination-account-string'); $cache->addProperty('destination-account-string');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$list = $journal->destinationAccountList(); $list = $journal->destinationAccountList();
@@ -116,7 +116,7 @@ class Journal extends Twig_Extension
$cache->addProperty('transaction-journal'); $cache->addProperty('transaction-journal');
$cache->addProperty('source-account-string'); $cache->addProperty('source-account-string');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$list = $journal->sourceAccountList(); $list = $journal->sourceAccountList();
@@ -152,7 +152,7 @@ class Journal extends Twig_Extension
$cache->addProperty('transaction-journal'); $cache->addProperty('transaction-journal');
$cache->addProperty('budget-string'); $cache->addProperty('budget-string');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
@@ -189,7 +189,7 @@ class Journal extends Twig_Extension
$cache->addProperty('transaction-journal'); $cache->addProperty('transaction-journal');
$cache->addProperty('category-string'); $cache->addProperty('category-string');
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get(); // @codeCoverageIgnore
} }
$categories = []; $categories = [];
// get all categories for the journal itself (easy): // get all categories for the journal itself (easy):