Various code cleanup.

This commit is contained in:
James Cole 2017-12-22 18:32:43 +01:00
parent f13a93348f
commit 8bd76d1ff0
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
188 changed files with 383 additions and 396 deletions

View File

@ -25,7 +25,6 @@ namespace FireflyIII\Console\Commands;
use Artisan; use Artisan;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Import\Logging\CommandHandler; use FireflyIII\Import\Logging\CommandHandler;
use FireflyIII\Import\Routine\ImportRoutine;
use FireflyIII\Import\Routine\RoutineInterface; use FireflyIII\Import\Routine\RoutineInterface;
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface; use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface;
@ -75,6 +74,7 @@ class CreateImport extends Command
* *
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) // cannot be helped * @SuppressWarnings(PHPMD.ExcessiveMethodLength) // cannot be helped
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five exactly. * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five exactly.
*
* @throws FireflyException * @throws FireflyException
*/ */
public function handle() public function handle()
@ -133,7 +133,7 @@ class CreateImport extends Command
$monolog->pushHandler($handler); $monolog->pushHandler($handler);
// start the actual routine: // start the actual routine:
$type = $job->file_type === 'csv' ? 'file' : $job->file_type; $type = 'csv' === $job->file_type ? 'file' : $job->file_type;
$key = sprintf('import.routine.%s', $type); $key = sprintf('import.routine.%s', $type);
$className = config($key); $className = config($key);
if (null === $className || !class_exists($className)) { if (null === $className || !class_exists($className)) {

View File

@ -24,7 +24,6 @@ namespace FireflyIII\Console\Commands;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Import\Logging\CommandHandler; use FireflyIII\Import\Logging\CommandHandler;
use FireflyIII\Import\Routine\ImportRoutine;
use FireflyIII\Import\Routine\RoutineInterface; use FireflyIII\Import\Routine\RoutineInterface;
use FireflyIII\Models\ImportJob; use FireflyIII\Models\ImportJob;
use Illuminate\Console\Command; use Illuminate\Console\Command;
@ -60,6 +59,8 @@ class Import extends Command
/** /**
* Run the import routine. * Run the import routine.
*
* @throws FireflyException
*/ */
public function handle() public function handle()
{ {
@ -84,7 +85,7 @@ class Import extends Command
$monolog->pushHandler($handler); $monolog->pushHandler($handler);
// actually start job: // actually start job:
$type = $job->file_type === 'csv' ? 'file' : $job->file_type; $type = 'csv' === $job->file_type ? 'file' : $job->file_type;
$key = sprintf('import.routine.%s', $type); $key = sprintf('import.routine.%s', $type);
$className = config($key); $className = config($key);
if (null === $className || !class_exists($className)) { if (null === $className || !class_exists($className)) {

View File

@ -26,8 +26,6 @@ use DB;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\AccountMeta; use FireflyIII\Models\AccountMeta;
use FireflyIII\Models\AccountType; use FireflyIII\Models\AccountType;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\Note; use FireflyIII\Models\Note;
use FireflyIII\Models\Transaction; use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionCurrency;

View File

@ -111,10 +111,10 @@ class VerifyDatabase extends Command
$token = $user->generateAccessToken(); $token = $user->generateAccessToken();
Preferences::setForUser($user, 'access_token', $token); Preferences::setForUser($user, 'access_token', $token);
$this->line(sprintf('Generated access token for user %s', $user->email)); $this->line(sprintf('Generated access token for user %s', $user->email));
$count++; ++$count;
} }
} }
if ($count === 0) { if (0 === $count) {
$this->info('All access tokens OK!'); $this->info('All access tokens OK!');
} }
} }
@ -138,12 +138,12 @@ class VerifyDatabase extends Command
$link->name = $name; $link->name = $name;
$link->outward = $values[0]; $link->outward = $values[0];
$link->inward = $values[1]; $link->inward = $values[1];
$count++; ++$count;
} }
$link->editable = false; $link->editable = false;
$link->save(); $link->save();
} }
if ($count === 0) { if (0 === $count) {
$this->info('All link types OK!'); $this->info('All link types OK!');
} }
} }
@ -158,7 +158,7 @@ class VerifyDatabase extends Command
->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')]); ->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')]);
/** @var stdClass $entry */ /** @var stdClass $entry */
foreach ($journals as $entry) { foreach ($journals as $entry) {
if (bccomp(strval($entry->the_sum), '0') !== 0) { if (0 !== bccomp(strval($entry->the_sum), '0')) {
$errored[] = $entry->transaction_journal_id; $errored[] = $entry->transaction_journal_id;
} }
} }
@ -167,14 +167,14 @@ class VerifyDatabase extends Command
$res = Transaction::whereNull('deleted_at')->where('transaction_journal_id', $journalId)->groupBy('amount')->get([DB::raw('MIN(id) as first_id')]); $res = Transaction::whereNull('deleted_at')->where('transaction_journal_id', $journalId)->groupBy('amount')->get([DB::raw('MIN(id) as first_id')]);
$ids = $res->pluck('first_id')->toArray(); $ids = $res->pluck('first_id')->toArray();
DB::table('transactions')->whereIn('id', $ids)->update(['amount' => DB::raw('amount * -1')]); DB::table('transactions')->whereIn('id', $ids)->update(['amount' => DB::raw('amount * -1')]);
$count++; ++$count;
// report about it // report about it
/** @var TransactionJournal $journal */ /** @var TransactionJournal $journal */
$journal = TransactionJournal::find($journalId); $journal = TransactionJournal::find($journalId);
if (is_null($journal)) { if (is_null($journal)) {
continue; continue;
} }
if ($journal->transactionType->type === TransactionType::OPENING_BALANCE) { if (TransactionType::OPENING_BALANCE === $journal->transactionType->type) {
$this->error( $this->error(
sprintf( sprintf(
'Transaction #%d was stored incorrectly. One of your asset accounts may show the wrong balance. Please visit /transactions/show/%d to verify the opening balance.', 'Transaction #%d was stored incorrectly. One of your asset accounts may show the wrong balance. Please visit /transactions/show/%d to verify the opening balance.',
@ -182,7 +182,7 @@ class VerifyDatabase extends Command
) )
); );
} }
if ($journal->transactionType->type !== TransactionType::OPENING_BALANCE) { if (TransactionType::OPENING_BALANCE !== $journal->transactionType->type) {
$this->error( $this->error(
sprintf( sprintf(
'Transaction #%d was stored incorrectly. Could be that the transaction shows the wrong amount. Please visit /transactions/show/%d to verify the opening balance.', 'Transaction #%d was stored incorrectly. Could be that the transaction shows the wrong amount. Please visit /transactions/show/%d to verify the opening balance.',
@ -191,7 +191,7 @@ class VerifyDatabase extends Command
); );
} }
} }
if ($count === 0) { if (0 === $count) {
$this->info('Amount integrity OK!'); $this->info('Amount integrity OK!');
} }
@ -371,9 +371,9 @@ class VerifyDatabase extends Command
'Error: Transaction #' . $entry->transaction_id . ' should have been deleted, but has not.' . 'Error: Transaction #' . $entry->transaction_id . ' should have been deleted, but has not.' .
' Find it in the table called "transactions" and change the "deleted_at" field to: "' . $entry->journal_deleted . '"' ' Find it in the table called "transactions" and change the "deleted_at" field to: "' . $entry->journal_deleted . '"'
); );
$count++; ++$count;
} }
if ($count === 0) { if (0 === $count) {
$this->info('No orphaned transactions!'); $this->info('No orphaned transactions!');
} }
} }
@ -393,9 +393,9 @@ class VerifyDatabase extends Command
$this->error( $this->error(
'Error: Journal #' . $entry->id . ' has zero transactions. Open table "transaction_journals" and delete the entry with id #' . $entry->id 'Error: Journal #' . $entry->id . ' has zero transactions. Open table "transaction_journals" and delete the entry with id #' . $entry->id
); );
$count++; ++$count;
} }
if ($count === 0) { if (0 === $count) {
$this->info('No orphaned journals!'); $this->info('No orphaned journals!');
} }
} }

View File

@ -81,6 +81,7 @@ class Handler extends ExceptionHandler
* @param \Exception $exception * @param \Exception $exception
* *
* @return mixed|void * @return mixed|void
*
* @throws Exception * @throws Exception
*/ */
public function report(Exception $exception) public function report(Exception $exception)

View File

@ -52,6 +52,7 @@ class CsvExporter extends BasicExporter implements ExporterInterface
/** /**
* @return bool * @return bool
*
* @throws \TypeError * @throws \TypeError
*/ */
public function run(): bool public function run(): bool

View File

@ -31,7 +31,6 @@ use Illuminate\Support\Collection;
*/ */
class MonthReportGenerator implements ReportGeneratorInterface class MonthReportGenerator implements ReportGeneratorInterface
{ {
/** @var Collection */ /** @var Collection */
private $accounts; private $accounts;
/** @var Carbon */ /** @var Carbon */
@ -43,6 +42,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/** /**
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function generate(): string public function generate(): string

View File

@ -32,7 +32,8 @@ class MultiYearReportGenerator extends MonthReportGenerator
/** /**
* @return string * @return string
*/ */
protected function preferredPeriod(): string { protected function preferredPeriod(): string
{
return 'year'; return 'year';
} }
} }

View File

@ -32,7 +32,8 @@ class YearReportGenerator extends MonthReportGenerator
/** /**
* @return string * @return string
*/ */
protected function preferredPeriod(): string { protected function preferredPeriod(): string
{
return 'month'; return 'month';
} }
} }

View File

@ -41,6 +41,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/** /**
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function generate(): string public function generate(): string

View File

@ -40,6 +40,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
/** /**
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function generate(): string public function generate(): string

View File

@ -40,6 +40,7 @@ class YearReportGenerator implements ReportGeneratorInterface
/** /**
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function generate(): string public function generate(): string

View File

@ -86,7 +86,7 @@ class UserEventHandler
return true; return true;
} }
// user is only user but has admin role // user is only user but has admin role
if ($count === 1 && $user->hasRole('owner')) { if (1 === $count && $user->hasRole('owner')) {
Log::debug(sprintf('User #%d is only user but has role owner so all is well.', $user->id)); Log::debug(sprintf('User #%d is only user but has role owner so all is well.', $user->id));
return true; return true;

View File

@ -41,40 +41,14 @@ class BillLine
/** @var string */ /** @var string */
protected $min; protected $min;
/** @var Carbon */ /** @var Carbon */
private $endOfPayDate;
/** @var Carbon */
private $lastHitDate; private $lastHitDate;
/** @var Carbon */ /** @var Carbon */
private $payDate; private $payDate;
/** @var Carbon */
private $endOfPayDate;
/** @var int */ /** @var int */
private $transactionJournalId; private $transactionJournalId;
/**
* @return Carbon
*/
public function getPayDate(): Carbon
{
return $this->payDate;
}
/**
* @return Carbon
*/
public function getEndOfPayDate(): Carbon
{
return $this->endOfPayDate;
}
/**
* @param Carbon $endOfPayDate
*/
public function setEndOfPayDate(Carbon $endOfPayDate): void
{
$this->endOfPayDate = $endOfPayDate;
}
/** /**
* BillLine constructor. * BillLine constructor.
*/ */
@ -115,6 +89,22 @@ class BillLine
$this->bill = $bill; $this->bill = $bill;
} }
/**
* @return Carbon
*/
public function getEndOfPayDate(): Carbon
{
return $this->endOfPayDate;
}
/**
* @param Carbon $endOfPayDate
*/
public function setEndOfPayDate(Carbon $endOfPayDate): void
{
$this->endOfPayDate = $endOfPayDate;
}
/** /**
* @return Carbon * @return Carbon
*/ */
@ -163,6 +153,22 @@ class BillLine
$this->min = $min; $this->min = $min;
} }
/**
* @return Carbon
*/
public function getPayDate(): Carbon
{
return $this->payDate;
}
/**
* @param Carbon $payDate
*/
public function setPayDate(Carbon $payDate): void
{
$this->payDate = $payDate;
}
/** /**
* @return int * @return int
*/ */
@ -202,12 +208,4 @@ class BillLine
{ {
$this->hit = $hit; $this->hit = $hit;
} }
/**
* @param Carbon $payDate
*/
public function setPayDate(Carbon $payDate): void
{
$this->payDate = $payDate;
}
} }

View File

@ -85,13 +85,6 @@ interface JournalCollectorInterface
*/ */
public function removeFilter(string $filter): JournalCollectorInterface; public function removeFilter(string $filter): JournalCollectorInterface;
/**
* @param Collection $accounts
*
* @return JournalCollectorInterface
*/
public function setOpposingAccounts(Collection $accounts): JournalCollectorInterface;
/** /**
* @param Collection $accounts * @param Collection $accounts
* *
@ -167,6 +160,13 @@ interface JournalCollectorInterface
*/ */
public function setOffset(int $offset): JournalCollectorInterface; public function setOffset(int $offset): JournalCollectorInterface;
/**
* @param Collection $accounts
*
* @return JournalCollectorInterface
*/
public function setOpposingAccounts(Collection $accounts): JournalCollectorInterface;
/** /**
* @param int $page * @param int $page
* *

View File

@ -26,8 +26,6 @@ use Illuminate\Support\Collection;
/** /**
* Interface FilterInterface * Interface FilterInterface
*
* @package FireflyIII\Helpers\Filter
*/ */
interface FilterInterface interface FilterInterface
{ {

View File

@ -79,12 +79,12 @@ class ReportHelper implements ReportHelperInterface
/** @var Bill $bill */ /** @var Bill $bill */
foreach ($bills as $bill) { foreach ($bills as $bill) {
$expectedDates = $repository->getPayDatesInRange($bill, $start, $end); $expectedDates = $repository->getPayDatesInRange($bill, $start, $end);
foreach($expectedDates as $payDate) { foreach ($expectedDates as $payDate) {
$endOfPayPeriod = app('navigation')->endOfX($payDate, $bill->repeat_freq, null); $endOfPayPeriod = app('navigation')->endOfX($payDate, $bill->repeat_freq, null);
$collector = app(JournalCollectorInterface::class); $collector = app(JournalCollectorInterface::class);
$collector->setAccounts($accounts)->setRange($payDate, $endOfPayPeriod)->setBills($bills); $collector->setAccounts($accounts)->setRange($payDate, $endOfPayPeriod)->setBills($bills);
$journals = $collector->getJournals(); $journals = $collector->getJournals();
$billLine = new BillLine; $billLine = new BillLine;
$billLine->setBill($bill); $billLine->setBill($bill);

View File

@ -43,6 +43,7 @@ use Session;
/** /**
* Class ReconcileController. * Class ReconcileController.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/ */
class ReconcileController extends Controller class ReconcileController extends Controller
@ -72,7 +73,7 @@ class ReconcileController extends Controller
*/ */
public function edit(TransactionJournal $journal) public function edit(TransactionJournal $journal)
{ {
if ($journal->transactionType->type !== TransactionType::RECONCILIATION) { if (TransactionType::RECONCILIATION !== $journal->transactionType->type) {
return redirect(route('transactions.edit', [$journal->id])); return redirect(route('transactions.edit', [$journal->id]));
} }
// view related code // view related code
@ -99,7 +100,6 @@ class ReconcileController extends Controller
'accounts.reconcile.edit', 'accounts.reconcile.edit',
compact('journal', 'subTitle') compact('journal', 'subTitle')
)->with('data', $preFilled); )->with('data', $preFilled);
} }
/** /**
@ -166,6 +166,7 @@ class ReconcileController extends Controller
* @param Carbon|null $end * @param Carbon|null $end
* *
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
*
* @throws FireflyException * @throws FireflyException
*/ */
public function reconcile(Account $account, Carbon $start = null, Carbon $end = null) public function reconcile(Account $account, Carbon $start = null, Carbon $end = null)
@ -226,7 +227,7 @@ class ReconcileController extends Controller
*/ */
public function show(JournalRepositoryInterface $repository, TransactionJournal $journal) public function show(JournalRepositoryInterface $repository, TransactionJournal $journal)
{ {
if ($journal->transactionType->type !== TransactionType::RECONCILIATION) { if (TransactionType::RECONCILIATION !== $journal->transactionType->type) {
return redirect(route('transactions.show', [$journal->id])); return redirect(route('transactions.show', [$journal->id]));
} }
$subTitle = trans('firefly.reconciliation') . ' "' . $journal->description . '"'; $subTitle = trans('firefly.reconciliation') . ' "' . $journal->description . '"';
@ -235,7 +236,6 @@ class ReconcileController extends Controller
$transaction = $repository->getAssetTransaction($journal); $transaction = $repository->getAssetTransaction($journal);
$account = $transaction->account; $account = $transaction->account;
return view('accounts.reconcile.show', compact('journal', 'subTitle', 'transaction', 'account')); return view('accounts.reconcile.show', compact('journal', 'subTitle', 'transaction', 'account'));
} }
@ -297,6 +297,7 @@ class ReconcileController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return mixed * @return mixed
*
* @throws \Throwable * @throws \Throwable
* @throws FireflyException * @throws FireflyException
*/ */
@ -346,10 +347,10 @@ class ReconcileController extends Controller
*/ */
public function update(ReconciliationFormRequest $request, AccountRepositoryInterface $repository, TransactionJournal $journal) public function update(ReconciliationFormRequest $request, AccountRepositoryInterface $repository, TransactionJournal $journal)
{ {
if ($journal->transactionType->type !== TransactionType::RECONCILIATION) { if (TransactionType::RECONCILIATION !== $journal->transactionType->type) {
return redirect(route('transactions.show', [$journal->id])); return redirect(route('transactions.show', [$journal->id]));
} }
if (bccomp('0', $request->get('amount')) === 0) { if (0 === bccomp('0', $request->get('amount'))) {
Session::flash('error', trans('firefly.amount_cannot_be_zero')); Session::flash('error', trans('firefly.amount_cannot_be_zero'));
return redirect(route('accounts.reconcile.edit', [$journal->id]))->withInput(); return redirect(route('accounts.reconcile.edit', [$journal->id]))->withInput();
@ -368,10 +369,8 @@ class ReconcileController extends Controller
// redirect to previous URL. // redirect to previous URL.
return redirect($this->getPreviousUri('reconcile.edit.uri')); return redirect($this->getPreviousUri('reconcile.edit.uri'));
} }
/** /**
* @param Account $account * @param Account $account
* *

View File

@ -152,6 +152,7 @@ class AccountController extends Controller
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* *
* @return View * @return View
*
* @throws FireflyException * @throws FireflyException
* @throws FireflyException * @throws FireflyException
* @throws FireflyException * @throws FireflyException
@ -229,9 +230,9 @@ class AccountController extends Controller
$types = config('firefly.accountTypesByIdentifier.' . $what); $types = config('firefly.accountTypesByIdentifier.' . $what);
$collection = $repository->getAccountsByType($types); $collection = $repository->getAccountsByType($types);
$total = $collection->count(); $total = $collection->count();
$page = intval($request->get('page')) === 0 ? 1 : intval($request->get('page')); $page = 0 === intval($request->get('page')) ? 1 : intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data); $pageSize = intval(Preferences::get('listPageSize', 50)->data);
$accounts = $collection->slice(($page-1) * $pageSize, $pageSize); $accounts = $collection->slice(($page - 1) * $pageSize, $pageSize);
unset($collection); unset($collection);
/** @var Carbon $start */ /** @var Carbon $start */
$start = clone session('start', Carbon::now()->startOfMonth()); $start = clone session('start', Carbon::now()->startOfMonth());
@ -272,6 +273,7 @@ class AccountController extends Controller
* *
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // long and complex but not that excessively so. * @SuppressWarnings(PHPMD.CyclomaticComplexity) // long and complex but not that excessively so.
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* @throws FireflyException * @throws FireflyException
*/ */
public function show(Request $request, JournalRepositoryInterface $repository, Account $account, string $moment = '') public function show(Request $request, JournalRepositoryInterface $repository, Account $account, string $moment = '')

View File

@ -45,7 +45,6 @@ class HomeController extends Controller
$this->middleware(IsSandStormUser::class)->except(['index']); $this->middleware(IsSandStormUser::class)->except(['index']);
} }
/** /**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/ */

View File

@ -24,7 +24,6 @@ namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Http\Middleware\IsSandStormUser;
use FireflyIII\Http\Requests\LinkTypeFormRequest; use FireflyIII\Http\Requests\LinkTypeFormRequest;
use FireflyIII\Models\LinkType; use FireflyIII\Models\LinkType;
use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface;

View File

@ -149,6 +149,7 @@ class AttachmentController extends Controller
* @param Attachment $attachment * @param Attachment $attachment
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/ */
public function preview(Attachment $attachment) public function preview(Attachment $attachment)

View File

@ -65,6 +65,7 @@ class LoginController extends Controller
* @param Request $request * @param Request $request
* *
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response|void * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response|void
*
* @throws \Illuminate\Validation\ValidationException * @throws \Illuminate\Validation\ValidationException
*/ */
public function login(Request $request) public function login(Request $request)

View File

@ -41,7 +41,6 @@ use Session;
*/ */
class RegisterController extends Controller class RegisterController extends Controller
{ {
use RegistersUsers; use RegistersUsers;
/** /**

View File

@ -69,7 +69,6 @@ class TwoFactorController extends Controller
/** /**
* @return mixed * @return mixed
*
*/ */
public function lostTwoFactor() public function lostTwoFactor()
{ {

View File

@ -246,7 +246,6 @@ class BillController extends Controller
$transactions = $collector->getPaginatedJournals(); $transactions = $collector->getPaginatedJournals();
$transactions->setPath(route('bills.show', [$bill->id])); $transactions->setPath(route('bills.show', [$bill->id]));
$bill->paidDates = $repository->getPaidDatesInRange($bill, $date, $end); $bill->paidDates = $repository->getPaidDatesInRange($bill, $date, $end);
$bill->payDates = $repository->getPayDatesInRange($bill, $date, $end); $bill->payDates = $repository->getPayDatesInRange($bill, $date, $end);
$lastPaidDate = $this->lastPaidDate($repository->getPaidDatesInRange($bill, $date, $end), $date); $lastPaidDate = $this->lastPaidDate($repository->getPaidDatesInRange($bill, $date, $end), $date);
@ -274,7 +273,6 @@ class BillController extends Controller
$request->session()->flash('success', strval(trans('firefly.stored_new_bill', ['name' => $bill->name]))); $request->session()->flash('success', strval(trans('firefly.stored_new_bill', ['name' => $bill->name])));
Preferences::mark(); Preferences::mark();
/** @var array $files */ /** @var array $files */
$files = $request->hasFile('attachments') ? $request->file('attachments') : null; $files = $request->hasFile('attachments') ? $request->file('attachments') : null;
$this->attachments->saveAttachmentsForModel($bill, $files); $this->attachments->saveAttachmentsForModel($bill, $files);
@ -341,7 +339,7 @@ class BillController extends Controller
*/ */
private function lastPaidDate(Collection $dates, Carbon $default): Carbon private function lastPaidDate(Collection $dates, Carbon $default): Carbon
{ {
if ($dates->count() === 0) { if (0 === $dates->count()) {
return $default; // @codeCoverageIgnore return $default; // @codeCoverageIgnore
} }
$latest = $dates->first(); $latest = $dates->first();
@ -353,6 +351,5 @@ class BillController extends Controller
} }
return $latest; return $latest;
} }
} }

View File

@ -85,7 +85,7 @@ class BudgetController extends Controller
$start = Carbon::createFromFormat('Y-m-d', $request->get('start')); $start = Carbon::createFromFormat('Y-m-d', $request->get('start'));
$end = Carbon::createFromFormat('Y-m-d', $request->get('end')); $end = Carbon::createFromFormat('Y-m-d', $request->get('end'));
$budgetLimit = $this->repository->updateLimitAmount($budget, $start, $end, $amount); $budgetLimit = $this->repository->updateLimitAmount($budget, $start, $end, $amount);
if (bccomp($amount, '0') === 0) { if (0 === bccomp($amount, '0')) {
$budgetLimit = null; $budgetLimit = null;
} }
@ -302,7 +302,7 @@ class BudgetController extends Controller
$currentStart = app('navigation')->addPeriod($currentStart, $range, 0); $currentStart = app('navigation')->addPeriod($currentStart, $range, 0);
++$count; ++$count;
} }
if ($count === 0) { if (0 === $count) {
$count = 1; // @codeCoverageIgnore $count = 1; // @codeCoverageIgnore
} }
$result['available'] = bcdiv($total, strval($count)); $result['available'] = bcdiv($total, strval($count));

View File

@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Chart; namespace FireflyIII\Http\Controllers\Chart;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface; use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Collector\JournalCollectorInterface; use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@ -341,7 +340,6 @@ class AccountController extends Controller
* @param Carbon $start * @param Carbon $start
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*
*/ */
public function period(Account $account, Carbon $start) public function period(Account $account, Carbon $start)
{ {

View File

@ -63,7 +63,6 @@ class ExpenseReportController extends Controller
); );
} }
/** /**
* @param Collection $accounts * @param Collection $accounts
* @param Collection $expense * @param Collection $expense
@ -74,7 +73,6 @@ class ExpenseReportController extends Controller
*/ */
public function mainChart(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) public function mainChart(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
{ {
$cache = new CacheProperties; $cache = new CacheProperties;
$cache->addProperty('chart.expense.report.main'); $cache->addProperty('chart.expense.report.main');
$cache->addProperty($accounts); $cache->addProperty($accounts);
@ -82,7 +80,7 @@ class ExpenseReportController 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()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end); $format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);

View File

@ -104,7 +104,7 @@ class HomeController extends Controller
*/ */
public function displayDebug(Request $request) public function displayDebug(Request $request)
{ {
$phpVersion = str_replace('~','\~',PHP_VERSION); $phpVersion = str_replace('~', '\~', PHP_VERSION);
$phpOs = php_uname(); $phpOs = php_uname();
$interface = PHP_SAPI; $interface = PHP_SAPI;
$now = Carbon::create()->format('Y-m-d H:i:s e'); $now = Carbon::create()->format('Y-m-d H:i:s e');

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Import; namespace FireflyIII\Http\Controllers\Import;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Middleware\IsDemoUser;
@ -66,6 +64,7 @@ class ConfigurationController extends Controller
* @param ImportJob $job * @param ImportJob $job
* *
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
*
* @throws FireflyException * @throws FireflyException
*/ */
public function index(ImportJob $job) public function index(ImportJob $job)
@ -95,6 +94,7 @@ class ConfigurationController extends Controller
* @param ImportJob $job * @param ImportJob $job
* *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
* @throws FireflyException * @throws FireflyException
*/ */
public function post(Request $request, ImportJob $job) public function post(Request $request, ImportJob $job)
@ -141,4 +141,4 @@ class ConfigurationController extends Controller
return $configurator; return $configurator;
} }
} }

View File

@ -18,16 +18,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Import; namespace FireflyIII\Http\Controllers\Import;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Import\Routine\ImportRoutine;
use FireflyIII\Import\Routine\RoutineInterface; use FireflyIII\Import\Routine\RoutineInterface;
use FireflyIII\Models\ImportJob; use FireflyIII\Models\ImportJob;
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface; use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
@ -61,7 +58,7 @@ class IndexController extends Controller
} }
); );
$this->middleware(IsDemoUser::class)->except(['create','index']); $this->middleware(IsDemoUser::class)->except(['create', 'index']);
} }
/** /**
@ -70,11 +67,12 @@ class IndexController extends Controller
* @param string $bank * @param string $bank
* *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
* @throws FireflyException * @throws FireflyException
*/ */
public function create(string $bank) public function create(string $bank)
{ {
if (!(config(sprintf('import.enabled.%s', $bank))) === true) { if (true === !(config(sprintf('import.enabled.%s', $bank)))) {
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank));
} }
@ -82,7 +80,6 @@ class IndexController extends Controller
// from here, always go to configure step. // from here, always go to configure step.
return redirect(route('import.configure', [$importJob->key])); return redirect(route('import.configure', [$importJob->key]));
} }
/** /**
@ -139,11 +136,11 @@ class IndexController extends Controller
* @param ImportJob $job * @param ImportJob $job
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*
* @throws FireflyException * @throws FireflyException
*/ */
public function start(ImportJob $job) public function start(ImportJob $job)
{ {
$type = $job->file_type; $type = $job->file_type;
$key = sprintf('import.routine.%s', $type); $key = sprintf('import.routine.%s', $type);
$className = config($key); $className = config($key);
@ -162,5 +159,4 @@ class IndexController extends Controller
throw new FireflyException('Job did not complete successfully. Please review the log files.'); throw new FireflyException('Job did not complete successfully. Please review the log files.');
} }
}
}

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Import; namespace FireflyIII\Http\Controllers\Import;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Import\Prerequisites\PrerequisitesInterface; use FireflyIII\Import\Prerequisites\PrerequisitesInterface;
@ -43,11 +41,12 @@ class PrerequisitesController extends Controller
* @param string $bank * @param string $bank
* *
* @return \Illuminate\Http\RedirectResponse|null * @return \Illuminate\Http\RedirectResponse|null
*
* @throws FireflyException * @throws FireflyException
*/ */
public function index(string $bank) public function index(string $bank)
{ {
if (!(config(sprintf('import.enabled.%s', $bank))) === true) { if (true === !(config(sprintf('import.enabled.%s', $bank)))) {
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank));
} }
$class = strval(config(sprintf('import.prerequisites.%s', $bank))); $class = strval(config(sprintf('import.prerequisites.%s', $bank)));
@ -83,6 +82,7 @@ class PrerequisitesController extends Controller
* @param string $bank * @param string $bank
* *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
* @throws FireflyException * @throws FireflyException
*/ */
public function post(Request $request, string $bank) public function post(Request $request, string $bank)
@ -112,6 +112,4 @@ class PrerequisitesController extends Controller
return redirect(route('import.create-job', [$bank])); return redirect(route('import.create-job', [$bank]));
} }
}
}

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Import; namespace FireflyIII\Http\Controllers\Import;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\ImportJob; use FireflyIII\Models\ImportJob;
use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Repositories\Tag\TagRepositoryInterface;
@ -34,7 +32,6 @@ use Response;
*/ */
class StatusController extends Controller class StatusController extends Controller
{ {
/** /**
* *
*/ */
@ -115,5 +112,4 @@ class StatusController extends Controller
return Response::json($result); return Response::json($result);
} }
}
}

View File

@ -88,7 +88,6 @@ class JavascriptController extends Controller
/** /**
* @param Request $request * @param Request $request
*
* @param AccountRepositoryInterface $repository * @param AccountRepositoryInterface $repository
* @param CurrencyRepositoryInterface $currencyRepository * @param CurrencyRepositoryInterface $currencyRepository
* *
@ -141,7 +140,7 @@ class JavascriptController extends Controller
$end = session('end'); $end = session('end');
$first = session('first'); $first = session('first');
$title = sprintf('%s - %s', $start->formatLocalized($this->monthAndDayFormat), $end->formatLocalized($this->monthAndDayFormat)); $title = sprintf('%s - %s', $start->formatLocalized($this->monthAndDayFormat), $end->formatLocalized($this->monthAndDayFormat));
$isCustom = session('is_custom_range', false) === true; $isCustom = true === session('is_custom_range', false);
$today = new Carbon; $today = new Carbon;
$ranges = [ $ranges = [
// first range is the current range: // first range is the current range:
@ -182,7 +181,6 @@ class JavascriptController extends Controller
$index = strval(trans('firefly.everything')); $index = strval(trans('firefly.everything'));
$ranges[$index] = [$first, new Carbon]; $ranges[$index] = [$first, new Carbon];
$return = [ $return = [
'title' => $title, 'title' => $title,
'configuration' => [ 'configuration' => [

View File

@ -36,6 +36,7 @@ class FrontpageController extends Controller
* @param PiggyBankRepositoryInterface $repository * @param PiggyBankRepositoryInterface $repository
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*
* @throws \Throwable * @throws \Throwable
*/ */
public function piggyBanks(PiggyBankRepositoryInterface $repository) public function piggyBanks(PiggyBankRepositoryInterface $repository)

View File

@ -46,6 +46,7 @@ class JsonController extends Controller
* @param Request $request * @param Request $request
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*
* @throws \Throwable * @throws \Throwable
*/ */
public function action(Request $request) public function action(Request $request)
@ -121,6 +122,7 @@ class JsonController extends Controller
* @param Request $request * @param Request $request
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*
* @throws \Throwable * @throws \Throwable
*/ */
public function trigger(Request $request) public function trigger(Request $request)

View File

@ -395,7 +395,6 @@ class PiggyBankController extends Controller
} }
$piggyBank = $repository->store($data); $piggyBank = $repository->store($data);
Session::flash('success', strval(trans('firefly.stored_piggy_bank', ['name' => $piggyBank->name]))); Session::flash('success', strval(trans('firefly.stored_piggy_bank', ['name' => $piggyBank->name])));
Preferences::mark(); Preferences::mark();

View File

@ -71,6 +71,7 @@ class PreferencesController extends Controller
/** /**
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
* @throws \Exception * @throws \Exception
* @throws \Exception * @throws \Exception
*/ */
@ -91,19 +92,19 @@ class PreferencesController extends Controller
*/ */
public function index(AccountRepositoryInterface $repository) public function index(AccountRepositoryInterface $repository)
{ {
$accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
$viewRangePref = Preferences::get('viewRange', '1M'); $viewRangePref = Preferences::get('viewRange', '1M');
$viewRange = $viewRangePref->data; $viewRange = $viewRangePref->data;
$frontPageAccounts = Preferences::get('frontPageAccounts', []); $frontPageAccounts = Preferences::get('frontPageAccounts', []);
$language = Preferences::get('language', config('firefly.default_language', 'en_US'))->data; $language = Preferences::get('language', config('firefly.default_language', 'en_US'))->data;
$listPageSize = Preferences::get('listPageSize', 50)->data; $listPageSize = Preferences::get('listPageSize', 50)->data;
$customFiscalYear = Preferences::get('customFiscalYear', 0)->data; $customFiscalYear = Preferences::get('customFiscalYear', 0)->data;
$showDeps = Preferences::get('showDepositsFrontpage', false)->data; $showDeps = Preferences::get('showDepositsFrontpage', false)->data;
$fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data; $fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data;
$fiscalYearStart = date('Y') . '-' . $fiscalYearStartStr; $fiscalYearStart = date('Y') . '-' . $fiscalYearStartStr;
$tjOptionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; $tjOptionalFields = Preferences::get('transaction_journal_optional_fields', [])->data;
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', 0)->data; // twoFactorAuthEnabled $is2faEnabled = Preferences::get('twoFactorAuthEnabled', 0)->data; // twoFactorAuthEnabled
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret'); // hasTwoFactorAuthSecret $has2faSecret = null !== Preferences::get('twoFactorAuthSecret'); // hasTwoFactorAuthSecret
return view( return view(
'preferences.index', 'preferences.index',

View File

@ -97,6 +97,7 @@ class ProfileController extends Controller
* @param string $token * @param string $token
* *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
* @throws FireflyException * @throws FireflyException
*/ */
public function confirmEmailChange(UserRepositoryInterface $repository, string $token) public function confirmEmailChange(UserRepositoryInterface $repository, string $token)
@ -286,7 +287,7 @@ class ProfileController extends Controller
// found user. // found user.
// which email address to return to? // which email address to return to?
$set = Preferences::beginsWith($user, 'previous_email_'); $set = Preferences::beginsWith($user, 'previous_email_');
/** @var string $match */ /** @var string $match */
$match = null; $match = null;
foreach ($set as $entry) { foreach ($set as $entry) {

View File

@ -39,6 +39,7 @@ class AccountController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return mixed|string * @return mixed|string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function general(Collection $accounts, Carbon $start, Carbon $end) public function general(Collection $accounts, Carbon $start, Carbon $end)

View File

@ -40,6 +40,7 @@ class BalanceController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return mixed|string * @return mixed|string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function general(BalanceReportHelperInterface $helper, Collection $accounts, Carbon $start, Carbon $end) public function general(BalanceReportHelperInterface $helper, Collection $accounts, Carbon $start, Carbon $end)

View File

@ -41,6 +41,7 @@ class BudgetController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return mixed|string * @return mixed|string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function general(BudgetReportHelperInterface $helper, Collection $accounts, Carbon $start, Carbon $end) public function general(BudgetReportHelperInterface $helper, Collection $accounts, Carbon $start, Carbon $end)
@ -69,6 +70,7 @@ class BudgetController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return mixed|string * @return mixed|string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function period(Collection $accounts, Carbon $start, Carbon $end) public function period(Collection $accounts, Carbon $start, Carbon $end)

View File

@ -40,6 +40,7 @@ class CategoryController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return mixed|string * @return mixed|string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function expenses(Collection $accounts, Carbon $start, Carbon $end) public function expenses(Collection $accounts, Carbon $start, Carbon $end)
@ -72,6 +73,7 @@ class CategoryController extends Controller
* @param Collection $accounts * @param Collection $accounts
* *
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function income(Collection $accounts, Carbon $start, Carbon $end) public function income(Collection $accounts, Carbon $start, Carbon $end)
@ -106,6 +108,7 @@ class CategoryController extends Controller
* @return mixed|string * @return mixed|string
* *
* @internal param ReportHelperInterface $helper * @internal param ReportHelperInterface $helper
*
* @throws \Throwable * @throws \Throwable
*/ */
public function operations(Collection $accounts, Carbon $start, Carbon $end) public function operations(Collection $accounts, Carbon $start, Carbon $end)

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Report; namespace FireflyIII\Http\Controllers\Report;
@ -34,7 +33,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\CacheProperties; use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class ExpenseController * Class ExpenseController
*/ */
@ -69,6 +67,7 @@ class ExpenseController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function budget(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) public function budget(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
@ -116,6 +115,7 @@ class ExpenseController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function category(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) public function category(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
@ -173,6 +173,7 @@ class ExpenseController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return array|mixed|string * @return array|mixed|string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function spent(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) public function spent(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
@ -193,7 +194,7 @@ class ExpenseController extends Controller
foreach ($combined as $name => $combi) { foreach ($combined as $name => $combi) {
/** /**
* @var string $name * @var string
* @var Collection $combi * @var Collection $combi
*/ */
$spent = $this->spentInPeriod($accounts, $combi, $start, $end); $spent = $this->spentInPeriod($accounts, $combi, $start, $end);
@ -208,7 +209,6 @@ class ExpenseController extends Controller
return $result; return $result;
// for period, get spent and earned for each account (by name) // for period, get spent and earned for each account (by name)
} }
/** /**
@ -218,6 +218,7 @@ class ExpenseController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function topExpense(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) public function topExpense(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
@ -254,7 +255,6 @@ class ExpenseController extends Controller
return $result; return $result;
} }
/** /**
* @param Collection $accounts * @param Collection $accounts
* @param Collection $expense * @param Collection $expense
@ -262,6 +262,7 @@ class ExpenseController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return mixed|string * @return mixed|string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function topIncome(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) public function topIncome(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
@ -343,17 +344,16 @@ class ExpenseController extends Controller
$categoryName = $transaction->transaction_category_name; $categoryName = $transaction->transaction_category_name;
$categoryId = intval($transaction->transaction_category_id); $categoryId = intval($transaction->transaction_category_id);
// if null, grab from journal: // if null, grab from journal:
if ($categoryId === 0) { if (0 === $categoryId) {
$categoryName = $transaction->transaction_journal_category_name; $categoryName = $transaction->transaction_journal_category_name;
$categoryId = intval($transaction->transaction_journal_category_id); $categoryId = intval($transaction->transaction_journal_category_id);
} }
if ($categoryId !== 0) { if (0 !== $categoryId) {
$categoryName = app('steam')->tryDecrypt($categoryName); $categoryName = app('steam')->tryDecrypt($categoryName);
} }
// if not set, set to zero: // if not set, set to zero:
if (!isset($sum[$categoryId][$currencyId])) { if (!isset($sum[$categoryId][$currencyId])) {
$sum[$categoryId] = [ $sum[$categoryId] = [
'grand_total' => '0', 'grand_total' => '0',
'name' => $categoryName, 'name' => $categoryName,
@ -371,7 +371,6 @@ class ExpenseController extends Controller
], ],
], ],
]; ];
} }
// add amount // add amount
@ -448,17 +447,16 @@ class ExpenseController extends Controller
$budgetName = $transaction->transaction_budget_name; $budgetName = $transaction->transaction_budget_name;
$budgetId = intval($transaction->transaction_budget_id); $budgetId = intval($transaction->transaction_budget_id);
// if null, grab from journal: // if null, grab from journal:
if ($budgetId === 0) { if (0 === $budgetId) {
$budgetName = $transaction->transaction_journal_budget_name; $budgetName = $transaction->transaction_journal_budget_name;
$budgetId = intval($transaction->transaction_journal_budget_id); $budgetId = intval($transaction->transaction_journal_budget_id);
} }
if ($budgetId !== 0) { if (0 !== $budgetId) {
$budgetName = app('steam')->tryDecrypt($budgetName); $budgetName = app('steam')->tryDecrypt($budgetName);
} }
// if not set, set to zero: // if not set, set to zero:
if (!isset($sum[$budgetId][$currencyId])) { if (!isset($sum[$budgetId][$currencyId])) {
$sum[$budgetId] = [ $sum[$budgetId] = [
'grand_total' => '0', 'grand_total' => '0',
'name' => $budgetName, 'name' => $budgetName,
@ -510,17 +508,16 @@ class ExpenseController extends Controller
$categoryName = $transaction->transaction_category_name; $categoryName = $transaction->transaction_category_name;
$categoryId = intval($transaction->transaction_category_id); $categoryId = intval($transaction->transaction_category_id);
// if null, grab from journal: // if null, grab from journal:
if ($categoryId === 0) { if (0 === $categoryId) {
$categoryName = $transaction->transaction_journal_category_name; $categoryName = $transaction->transaction_journal_category_name;
$categoryId = intval($transaction->transaction_journal_category_id); $categoryId = intval($transaction->transaction_journal_category_id);
} }
if ($categoryId !== 0) { if (0 !== $categoryId) {
$categoryName = app('steam')->tryDecrypt($categoryName); $categoryName = app('steam')->tryDecrypt($categoryName);
} }
// if not set, set to zero: // if not set, set to zero:
if (!isset($sum[$categoryId][$currencyId])) { if (!isset($sum[$categoryId][$currencyId])) {
$sum[$categoryId] = [ $sum[$categoryId] = [
'grand_total' => '0', 'grand_total' => '0',
'name' => $categoryName, 'name' => $categoryName,
@ -591,5 +588,4 @@ class ExpenseController extends Controller
return $sum; return $sum;
} }
}
}

View File

@ -40,6 +40,7 @@ class OperationsController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return mixed|string * @return mixed|string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function expenses(AccountTaskerInterface $tasker, Collection $accounts, Carbon $start, Carbon $end) public function expenses(AccountTaskerInterface $tasker, Collection $accounts, Carbon $start, Carbon $end)
@ -68,6 +69,7 @@ class OperationsController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function income(AccountTaskerInterface $tasker, Collection $accounts, Carbon $start, Carbon $end) public function income(AccountTaskerInterface $tasker, Collection $accounts, Carbon $start, Carbon $end)
@ -97,6 +99,7 @@ class OperationsController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return mixed|string * @return mixed|string
*
* @throws \Throwable * @throws \Throwable
*/ */
public function operations(AccountTaskerInterface $tasker, Collection $accounts, Carbon $start, Carbon $end) public function operations(AccountTaskerInterface $tasker, Collection $accounts, Carbon $start, Carbon $end)

View File

@ -75,12 +75,13 @@ class ReportController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return string * @return string
*
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
*/ */
public function accountReport(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) public function accountReport(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
{ {
if ($end < $start) { if ($end < $start) {
return view('error')->with('message', trans('firefly.end_after_start_date'));// @codeCoverageIgnore return view('error')->with('message', trans('firefly.end_after_start_date')); // @codeCoverageIgnore
} }
if ($start < session('first')) { if ($start < session('first')) {
@ -90,7 +91,7 @@ class ReportController extends Controller
View::share( View::share(
'subTitle', trans( 'subTitle', trans(
'firefly.report_default', 'firefly.report_default',
['start' => $start->formatLocalized($this->monthFormat), 'end' => $end->formatLocalized($this->monthFormat),] ['start' => $start->formatLocalized($this->monthFormat), 'end' => $end->formatLocalized($this->monthFormat)]
) )
); );
@ -108,6 +109,7 @@ class ReportController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return string * @return string
*
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
*/ */
public function auditReport(Collection $accounts, Carbon $start, Carbon $end) public function auditReport(Collection $accounts, Carbon $start, Carbon $end)
@ -144,6 +146,7 @@ class ReportController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return string * @return string
*
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
*/ */
public function budgetReport(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end) public function budgetReport(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end)
@ -181,6 +184,7 @@ class ReportController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return string * @return string
*
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
*/ */
public function categoryReport(Collection $accounts, Collection $categories, Carbon $start, Carbon $end) public function categoryReport(Collection $accounts, Collection $categories, Carbon $start, Carbon $end)
@ -217,6 +221,7 @@ class ReportController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return string * @return string
*
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
*/ */
public function defaultReport(Collection $accounts, Carbon $start, Carbon $end) public function defaultReport(Collection $accounts, Carbon $start, Carbon $end)
@ -268,6 +273,7 @@ class ReportController extends Controller
* @param string $reportType * @param string $reportType
* *
* @return mixed * @return mixed
*
* @throws \Throwable * @throws \Throwable
*/ */
public function options(string $reportType) public function options(string $reportType)
@ -297,6 +303,7 @@ class ReportController extends Controller
* @param ReportFormRequest $request * @param ReportFormRequest $request
* *
* @return RedirectResponse|\Illuminate\Routing\Redirector * @return RedirectResponse|\Illuminate\Routing\Redirector
*
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
* @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/ */
@ -373,6 +380,7 @@ class ReportController extends Controller
* @param Carbon $end * @param Carbon $end
* *
* @return string * @return string
*
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
*/ */
public function tagReport(Collection $accounts, Collection $tags, Carbon $start, Carbon $end) public function tagReport(Collection $accounts, Collection $tags, Carbon $start, Carbon $end)
@ -405,6 +413,7 @@ class ReportController extends Controller
/** /**
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
private function accountReportOptions(): string private function accountReportOptions(): string
@ -428,6 +437,7 @@ class ReportController extends Controller
/** /**
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
private function budgetReportOptions(): string private function budgetReportOptions(): string
@ -442,6 +452,7 @@ class ReportController extends Controller
/** /**
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
private function categoryReportOptions(): string private function categoryReportOptions(): string
@ -456,6 +467,7 @@ class ReportController extends Controller
/** /**
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
private function noReportOptions(): string private function noReportOptions(): string
@ -465,6 +477,7 @@ class ReportController extends Controller
/** /**
* @return string * @return string
*
* @throws \Throwable * @throws \Throwable
*/ */
private function tagReportOptions(): string private function tagReportOptions(): string

View File

@ -72,6 +72,7 @@ class RuleController extends Controller
* @param RuleGroup $ruleGroup * @param RuleGroup $ruleGroup
* *
* @return View * @return View
*
* @throws \Throwable * @throws \Throwable
* @throws \Throwable * @throws \Throwable
*/ */
@ -166,6 +167,7 @@ class RuleController extends Controller
* @param Rule $rule * @param Rule $rule
* *
* @return View * @return View
*
* @throws \Throwable * @throws \Throwable
* @throws \Throwable * @throws \Throwable
* @throws \Throwable * @throws \Throwable
@ -362,6 +364,7 @@ class RuleController extends Controller
* @param TestRuleFormRequest $request * @param TestRuleFormRequest $request
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*
* @throws \Throwable * @throws \Throwable
*/ */
public function testTriggers(TestRuleFormRequest $request) public function testTriggers(TestRuleFormRequest $request)
@ -410,6 +413,7 @@ class RuleController extends Controller
* @param Rule $rule * @param Rule $rule
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*
* @throws \Throwable * @throws \Throwable
*/ */
public function testTriggersByRule(Rule $rule) public function testTriggersByRule(Rule $rule)
@ -535,6 +539,7 @@ class RuleController extends Controller
* @param Rule $rule * @param Rule $rule
* *
* @return array * @return array
*
* @throws \Throwable * @throws \Throwable
*/ */
private function getCurrentActions(Rule $rule) private function getCurrentActions(Rule $rule)
@ -564,6 +569,7 @@ class RuleController extends Controller
* @param Rule $rule * @param Rule $rule
* *
* @return array * @return array
*
* @throws \Throwable * @throws \Throwable
*/ */
private function getCurrentTriggers(Rule $rule) private function getCurrentTriggers(Rule $rule)
@ -595,6 +601,7 @@ class RuleController extends Controller
* @param Request $request * @param Request $request
* *
* @return array * @return array
*
* @throws \Throwable * @throws \Throwable
*/ */
private function getPreviousActions(Request $request) private function getPreviousActions(Request $request)
@ -625,6 +632,7 @@ class RuleController extends Controller
* @param Request $request * @param Request $request
* *
* @return array * @return array
*
* @throws \Throwable * @throws \Throwable
*/ */
private function getPreviousTriggers(Request $request) private function getPreviousTriggers(Request $request)

View File

@ -74,6 +74,7 @@ class SearchController extends Controller
* @param SearchInterface $searcher * @param SearchInterface $searcher
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*
* @throws \Throwable * @throws \Throwable
*/ */
public function search(Request $request, SearchInterface $searcher) public function search(Request $request, SearchInterface $searcher)

View File

@ -128,6 +128,7 @@ class ConvertController extends Controller
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
* @throws FireflyException * @throws FireflyException
* @throws FireflyException * @throws FireflyException
*/ */

View File

@ -257,7 +257,7 @@ class SingleController extends Controller
$assetAccounts = $this->groupedAccountList(); $assetAccounts = $this->groupedAccountList();
$budgetList = ExpandedForm::makeSelectListWithEmpty($this->budgets->getBudgets()); $budgetList = ExpandedForm::makeSelectListWithEmpty($this->budgets->getBudgets());
if ($journal->transactionType->type === TransactionType::RECONCILIATION) { if (TransactionType::RECONCILIATION === $journal->transactionType->type) {
return redirect(route('accounts.reconcile.edit', [$journal->id])); return redirect(route('accounts.reconcile.edit', [$journal->id]));
} }

View File

@ -116,7 +116,6 @@ class SplitController extends Controller
$accountArray[$account->id]['currency_id'] = intval($account->getMeta('currency_id')); $accountArray[$account->id]['currency_id'] = intval($account->getMeta('currency_id'));
} }
// put previous url in session if not redirect from store (not "return_to_edit"). // put previous url in session if not redirect from store (not "return_to_edit").
if (true !== session('transactions.edit-split.fromUpdate')) { if (true !== session('transactions.edit-split.fromUpdate')) {
$this->rememberPreviousUri('transactions.edit-split.uri'); $this->rememberPreviousUri('transactions.edit-split.uri');

View File

@ -69,6 +69,7 @@ class TransactionController extends Controller
* @param string $moment * @param string $moment
* *
* @return View * @return View
*
* @throws FireflyException * @throws FireflyException
*/ */
public function index(Request $request, JournalRepositoryInterface $repository, string $what, string $moment = '') public function index(Request $request, JournalRepositoryInterface $repository, string $what, string $moment = '')
@ -142,7 +143,8 @@ class TransactionController extends Controller
$repository->reconcile($transaction); $repository->reconcile($transaction);
} }
return Response::json(['ok'=>'reconciled']);
return Response::json(['ok' => 'reconciled']);
} }
/** /**
@ -183,7 +185,7 @@ class TransactionController extends Controller
if ($this->isOpeningBalance($journal)) { if ($this->isOpeningBalance($journal)) {
return $this->redirectToAccount($journal); return $this->redirectToAccount($journal);
} }
if ($journal->transactionType->type === TransactionType::RECONCILIATION) { if (TransactionType::RECONCILIATION === $journal->transactionType->type) {
return redirect(route('accounts.reconcile.show', [$journal->id])); // @codeCoverageIgnore return redirect(route('accounts.reconcile.show', [$journal->id])); // @codeCoverageIgnore
} }
$linkTypes = $linkTypeRepository->get(); $linkTypes = $linkTypeRepository->get();
@ -200,7 +202,6 @@ class TransactionController extends Controller
* @param string $what * @param string $what
* *
* @return Collection * @return Collection
*
*/ */
private function getPeriodOverview(string $what): Collection private function getPeriodOverview(string $what): Collection
{ {

View File

@ -45,9 +45,9 @@ class IsDemoUser
public function handle(Request $request, Closure $next, $guard = null) public function handle(Request $request, Closure $next, $guard = null)
{ {
if (Auth::guard($guard)->guest()) { if (Auth::guard($guard)->guest()) {
// don't care when not logged in, usual stuff applies: // don't care when not logged in, usual stuff applies:
return $next($request); return $next($request);
} }
/** @var User $user */ /** @var User $user */
$user = auth()->user(); $user = auth()->user();
if ($user->hasRole('demo')) { if ($user->hasRole('demo')) {

View File

@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Http\Middleware; namespace FireflyIII\Http\Middleware;
use Closure; use Closure;
use FireflyIII\User;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Session; use Session;

View File

@ -84,6 +84,7 @@ class JournalFormRequest extends Request
/** /**
* @return array * @return array
*
* @throws FireflyException * @throws FireflyException
*/ */
public function rules() public function rules()

View File

@ -64,5 +64,4 @@ class ReconciliationFormRequest extends Request
return $rules; return $rules;
} }
} }

View File

@ -171,6 +171,7 @@ class SpectreConfigurator implements ConfiguratorInterface
break; break;
case !$this->job->configuration['has-input-mandatory']: case !$this->job->configuration['has-input-mandatory']:
$class = InputMandatory::class; $class = InputMandatory::class;
// no break
default: default:
break; break;
} }

View File

@ -70,7 +70,7 @@ class Amount implements ConverterInterface
if (is_null($decimal)) { if (is_null($decimal)) {
Log::debug('Decimal is still NULL, probably number with >2 decimals. Search for a dot.'); Log::debug('Decimal is still NULL, probably number with >2 decimals. Search for a dot.');
$res = strrpos($value, '.'); $res = strrpos($value, '.');
if (!($res === false)) { if (!(false === $res)) {
// blandly assume this is the one. // blandly assume this is the one.
Log::debug(sprintf('Searched from the left for "." in amount "%s", assume this is the decimal sign.', $value)); Log::debug(sprintf('Searched from the left for "." in amount "%s", assume this is the decimal sign.', $value));
$decimal = '.'; $decimal = '.';

View File

@ -70,6 +70,7 @@ class CsvProcessor implements FileProcessorInterface
* Does the actual job. * Does the actual job.
* *
* @return bool * @return bool
*
* @throws \League\Csv\Exception * @throws \League\Csv\Exception
*/ */
public function run(): bool public function run(): bool
@ -160,6 +161,7 @@ class CsvProcessor implements FileProcessorInterface
/** /**
* @return Iterator * @return Iterator
*
* @throws \League\Csv\Exception * @throws \League\Csv\Exception
* @throws \League\Csv\Exception * @throws \League\Csv\Exception
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
@ -174,7 +176,7 @@ class CsvProcessor implements FileProcessorInterface
$delimiter = "\t"; $delimiter = "\t";
} }
$reader->setDelimiter($delimiter); $reader->setDelimiter($delimiter);
if($config['has-headers']) { if ($config['has-headers']) {
$reader->setHeaderOffset(0); $reader->setHeaderOffset(0);
} }
$results = $reader->getRecords(); $results = $reader->getRecords();
@ -279,6 +281,7 @@ class CsvProcessor implements FileProcessorInterface
* @param array $array * @param array $array
* *
* @return bool * @return bool
*
* @throws FireflyException * @throws FireflyException
*/ */
private function rowAlreadyImported(array $array): bool private function rowAlreadyImported(array $array): bool

View File

@ -337,4 +337,4 @@ class BunqPrerequisites implements PrerequisitesInterface
return $deviceServerId; return $deviceServerId;
} }
} }

View File

@ -92,5 +92,4 @@ class FilePrerequisites implements PrerequisitesInterface
{ {
return new MessageBag; return new MessageBag;
} }
} }

View File

@ -28,8 +28,6 @@ use Illuminate\Support\MessageBag;
/** /**
* Interface PrerequisitesInterface * Interface PrerequisitesInterface
*
* @package FireflyIII\Import\Prerequisites
*/ */
interface PrerequisitesInterface interface PrerequisitesInterface
{ {

View File

@ -27,8 +27,6 @@ use Illuminate\Support\Collection;
/** /**
* Interface RoutineInterface * Interface RoutineInterface
*
* @package FireflyIII\Import\Routine
*/ */
interface RoutineInterface interface RoutineInterface
{ {
@ -58,6 +56,4 @@ interface RoutineInterface
* @return mixed * @return mixed
*/ */
public function setJob(ImportJob $job); public function setJob(ImportJob $job);
} }

View File

@ -25,9 +25,9 @@ namespace FireflyIII\Import\Routine;
use FireflyIII\Models\ImportJob; use FireflyIII\Models\ImportJob;
use FireflyIII\Services\Spectre\Object\Customer; use FireflyIII\Services\Spectre\Object\Customer;
use FireflyIII\Services\Spectre\Request\NewCustomerRequest; use FireflyIII\Services\Spectre\Request\NewCustomerRequest;
use Preferences;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log; use Log;
use Preferences;
/** /**
* Class FileRoutine * Class FileRoutine
@ -91,7 +91,6 @@ class SpectreRoutine implements RoutineInterface
// create customer if user does not have one: // create customer if user does not have one:
$customer = $this->getCustomer(); $customer = $this->getCustomer();
return true; return true;
} }
@ -113,7 +112,6 @@ class SpectreRoutine implements RoutineInterface
echo '<pre>'; echo '<pre>';
print_r($newCustomerRequest->getCustomer()); print_r($newCustomerRequest->getCustomer());
exit; exit;
} }
/** /**
@ -128,6 +126,4 @@ class SpectreRoutine implements RoutineInterface
var_dump($preference->data); var_dump($preference->data);
exit; exit;
} }
} }

View File

@ -127,7 +127,7 @@ class IngDescription implements SpecificInterface
private function copyDescriptionToOpposite(): void private function copyDescriptionToOpposite(): void
{ {
$search = ['Naar Oranje Spaarrekening ', 'Afschrijvingen']; $search = ['Naar Oranje Spaarrekening ', 'Afschrijvingen'];
if (strlen($this->row[3]) === 0) { if (0 === strlen($this->row[3])) {
$this->row[3] = trim(str_ireplace($search, '', $this->row[8])); $this->row[3] = trim(str_ireplace($search, '', $this->row[8]));
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Import\Specifics; namespace FireflyIII\Import\Specifics;

View File

@ -45,11 +45,11 @@ class ImportStorage
public $errors; public $errors;
/** @var Collection */ /** @var Collection */
public $journals; public $journals;
/** @var BillRepositoryInterface */ /** @var BillRepositoryInterface */
protected $billRepository; // yes, hard coded protected $billRepository; // yes, hard coded
/** @var Collection */ /** @var Collection */
protected $bills; protected $bills;
/** @var int */ /** @var int */
protected $defaultCurrencyId = 1; protected $defaultCurrencyId = 1;
/** @var ImportJob */ /** @var ImportJob */
protected $job; protected $job;
@ -96,11 +96,11 @@ class ImportStorage
$config = $job->configuration; $config = $job->configuration;
$this->applyRules = $config['apply_rules'] ?? false; $this->applyRules = $config['apply_rules'] ?? false;
$this->matchBills = $config['match_bills'] ?? false; $this->matchBills = $config['match_bills'] ?? false;
if ($this->applyRules === true) { if (true === $this->applyRules) {
Log::debug('applyRules seems to be true, get the rules.'); Log::debug('applyRules seems to be true, get the rules.');
$this->rules = $this->getRules(); $this->rules = $this->getRules();
} }
if ($this->matchBills === true) { if (true === $this->matchBills) {
Log::debug('matchBills seems to be true, get the bills'); Log::debug('matchBills seems to be true, get the bills');
$this->bills = $this->getBills(); $this->bills = $this->getBills();
$this->billRepository = app(BillRepositoryInterface::class); $this->billRepository = app(BillRepositoryInterface::class);
@ -226,22 +226,22 @@ class ImportStorage
$this->job->addStepsDone(1); $this->job->addStepsDone(1);
// run rules if config calls for it: // run rules if config calls for it:
if ($this->applyRules === true) { if (true === $this->applyRules) {
Log::info('Will apply rules to this journal.'); Log::info('Will apply rules to this journal.');
$this->applyRules($journal); $this->applyRules($journal);
} }
if (!($this->applyRules === true)) { if (!(true === $this->applyRules)) {
Log::info('Will NOT apply rules to this journal.'); Log::info('Will NOT apply rules to this journal.');
} }
// match bills if config calls for it. // match bills if config calls for it.
if ($this->matchBills === true) { if (true === $this->matchBills) {
//$this->/applyRules($journal); //$this->/applyRules($journal);
Log::info('Cannot match bills (yet).'); Log::info('Cannot match bills (yet).');
$this->matchBills($journal); $this->matchBills($journal);
} }
if (!($this->matchBills === true)) { if (!(true === $this->matchBills)) {
Log::info('Cannot match bills (yet), but do not have to.'); Log::info('Cannot match bills (yet), but do not have to.');
} }

View File

@ -93,8 +93,9 @@ trait ImportSupport
*/ */
protected function matchBills(TransactionJournal $journal): bool protected function matchBills(TransactionJournal $journal): bool
{ {
if(!is_null($journal->bill_id)) { if (!is_null($journal->bill_id)) {
Log::debug('Journal is already linked to a bill, will not scan.'); Log::debug('Journal is already linked to a bill, will not scan.');
return true; return true;
} }
if ($this->bills->count() > 0) { if ($this->bills->count() > 0) {
@ -264,6 +265,7 @@ trait ImportSupport
* *
* @return string * @return string
*x *x
*
* @throws FireflyException * @throws FireflyException
* *
* @see ImportSupport::getOpposingAccount() * @see ImportSupport::getOpposingAccount()
@ -412,6 +414,7 @@ trait ImportSupport
* @param array $parameters * @param array $parameters
* *
* @return TransactionJournal * @return TransactionJournal
*
* @throws FireflyException * @throws FireflyException
*/ */
private function storeJournal(array $parameters): TransactionJournal private function storeJournal(array $parameters): TransactionJournal

View File

@ -93,6 +93,14 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue
$this->endDate = $date; $this->endDate = $date;
} }
/**
* @return Rule
*/
public function getRule(): Rule
{
return $this->rule;
}
/** /**
* @return \Carbon\Carbon * @return \Carbon\Carbon
*/ */
@ -117,15 +125,6 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue
return $this->user; return $this->user;
} }
/**
* @return Rule
*/
public function getRule(): Rule
{
return $this->rule;
}
/** /**
* @param User $user * @param User $user
*/ */

View File

@ -1,4 +1,6 @@
<?php <?php
declare(strict_types=1);
/** /**
* GetSpectreProviders.php * GetSpectreProviders.php
* Copyright (c) 2017 thegrumpydictator@gmail.com * Copyright (c) 2017 thegrumpydictator@gmail.com
@ -92,8 +94,8 @@ class GetSpectreProviders implements ShouldQueue
$dbProvider->code = $provider['code']; $dbProvider->code = $provider['code'];
$dbProvider->mode = $provider['mode']; $dbProvider->mode = $provider['mode'];
$dbProvider->status = $provider['status']; $dbProvider->status = $provider['status'];
$dbProvider->interactive = $provider['interactive'] === 1; $dbProvider->interactive = 1 === $provider['interactive'];
$dbProvider->automatic_fetch = $provider['automatic_fetch'] === 1; $dbProvider->automatic_fetch = 1 === $provider['automatic_fetch'];
$dbProvider->country_code = $provider['country_code']; $dbProvider->country_code = $provider['country_code'];
$dbProvider->data = $provider; $dbProvider->data = $provider;
$dbProvider->save(); $dbProvider->save();

View File

@ -18,10 +18,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Mail; namespace FireflyIII\Mail;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Mail; namespace FireflyIII\Mail;

View File

@ -18,11 +18,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Mail; namespace FireflyIII\Mail;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
@ -36,7 +33,7 @@ class UndoEmailChangeMail extends Mailable
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
/** @var string IP address of user*/ /** @var string IP address of user */
public $ipAddress; public $ipAddress;
/** @var string New email address */ /** @var string New email address */
public $newEmail; public $newEmail;

View File

@ -63,7 +63,7 @@ class Account extends Model
* @var array * @var array
*/ */
protected $rules protected $rules
= [ = [
'user_id' => 'required|exists:users,id', 'user_id' => 'required|exists:users,id',
'account_type_id' => 'required|exists:account_types,id', 'account_type_id' => 'required|exists:account_types,id',
'name' => 'required|between:1,200', 'name' => 'required|between:1,200',
@ -118,7 +118,7 @@ class Account extends Model
* *
* @return Account * @return Account
*/ */
public static function routeBinder(Account $value) public static function routeBinder(self $value)
{ {
if (auth()->check()) { if (auth()->check()) {
if (intval($value->user_id) === auth()->user()->id) { if (intval($value->user_id) === auth()->user()->id) {
@ -218,7 +218,6 @@ class Account extends Model
* Returns the opening balance. * Returns the opening balance.
* *
* @return TransactionJournal * @return TransactionJournal
*
*/ */
public function getOpeningBalance(): TransactionJournal public function getOpeningBalance(): TransactionJournal
{ {
@ -268,7 +267,6 @@ class Account extends Model
* Returns the date of the opening balance for this account. If no date, will return 01-01-1900. * Returns the date of the opening balance for this account. If no date, will return 01-01-1900.
* *
* @return Carbon * @return Carbon
*
*/ */
public function getOpeningBalanceDate(): Carbon public function getOpeningBalanceDate(): Carbon
{ {

View File

@ -30,7 +30,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
*/ */
class AccountType extends Model class AccountType extends Model
{ {
const DEFAULT = 'Default account'; const DEFAULT = 'Default account';
/** /**
* *
*/ */

View File

@ -42,7 +42,7 @@ class Bill extends Model
* @var array * @var array
*/ */
protected $casts protected $casts
= [ = [
'created_at' => 'datetime', 'created_at' => 'datetime',
'updated_at' => 'datetime', 'updated_at' => 'datetime',
'deleted_at' => 'datetime', 'deleted_at' => 'datetime',
@ -57,8 +57,8 @@ class Bill extends Model
* @var array * @var array
*/ */
protected $fillable protected $fillable
= ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', = ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip',
'automatch', 'active',]; 'automatch', 'active',];
/** /**
* @var array * @var array
*/ */

View File

@ -38,7 +38,7 @@ class Configuration extends Model
* @var array * @var array
*/ */
protected $casts protected $casts
= [ = [
'created_at' => 'datetime', 'created_at' => 'datetime',
'updated_at' => 'datetime', 'updated_at' => 'datetime',
]; ];

View File

@ -179,6 +179,7 @@ class ImportJob extends Model
/** /**
* @return string * @return string
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/ */
public function uploadFileContents(): string public function uploadFileContents(): string

View File

@ -41,7 +41,7 @@ class PiggyBankEvent extends Model
'date' => 'datetime', 'date' => 'datetime',
]; ];
/** @var array */ /** @var array */
protected $dates = ['date']; protected $dates = ['date'];
/** /**
* @var array * @var array
*/ */

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Models; namespace FireflyIII\Models;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
/** /**
@ -51,5 +49,4 @@ class SpectreProvider extends Model
* @var array * @var array
*/ */
protected $fillable = ['spectre_id', 'code', 'mode', 'name', 'status', 'interactive', 'automatic_fetch', 'country_code', 'data']; protected $fillable = ['spectre_id', 'code', 'mode', 'name', 'status', 'interactive', 'automatic_fetch', 'country_code', 'data'];
}
}

View File

@ -105,6 +105,7 @@ class Tag extends Model
* @param Tag $tag * @param Tag $tag
* *
* @return string * @return string
*
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
*/ */
public static function tagSum(self $tag): string public static function tagSum(self $tag): string

View File

@ -75,7 +75,7 @@ class Transaction extends Model
* @var array * @var array
*/ */
protected $casts protected $casts
= [ = [
'created_at' => 'datetime', 'created_at' => 'datetime',
'updated_at' => 'datetime', 'updated_at' => 'datetime',
'deleted_at' => 'datetime', 'deleted_at' => 'datetime',
@ -88,8 +88,8 @@ class Transaction extends Model
* @var array * @var array
*/ */
protected $fillable protected $fillable
= ['account_id', 'transaction_journal_id', 'description', 'amount', 'identifier', 'transaction_currency_id', 'foreign_currency_id', = ['account_id', 'transaction_journal_id', 'description', 'amount', 'identifier', 'transaction_currency_id', 'foreign_currency_id',
'foreign_amount',]; 'foreign_amount',];
/** /**
* @var array * @var array
*/ */
@ -98,7 +98,7 @@ class Transaction extends Model
* @var array * @var array
*/ */
protected $rules protected $rules
= [ = [
'account_id' => 'required|exists:accounts,id', 'account_id' => 'required|exists:accounts,id',
'transaction_journal_id' => 'required|exists:transaction_journals,id', 'transaction_journal_id' => 'required|exists:transaction_journals,id',
'transaction_currency_id' => 'required|exists:transaction_currencies,id', 'transaction_currency_id' => 'required|exists:transaction_currencies,id',

View File

@ -51,7 +51,7 @@ class ExportJobServiceProvider extends ServiceProvider
} }
/** /**
* * Register export job.
*/ */
private function exportJob() private function exportJob()
{ {
@ -69,6 +69,9 @@ class ExportJobServiceProvider extends ServiceProvider
); );
} }
/**
* Register import job.
*/
private function importJob() private function importJob()
{ {
$this->app->bind( $this->app->bind(

View File

@ -73,6 +73,9 @@ use Validator;
*/ */
class FireflyServiceProvider extends ServiceProvider class FireflyServiceProvider extends ServiceProvider
{ {
/**
* Start provider.
*/
public function boot() public function boot()
{ {
Validator::resolver( Validator::resolver(
@ -94,7 +97,7 @@ class FireflyServiceProvider extends ServiceProvider
} }
/** /**
* * Register stuff.
*/ */
public function register() public function register()
{ {

View File

@ -43,7 +43,6 @@ use Validator;
*/ */
class AccountRepository implements AccountRepositoryInterface class AccountRepository implements AccountRepositoryInterface
{ {
/** @var User */ /** @var User */
private $user; private $user;
@ -72,6 +71,7 @@ class AccountRepository implements AccountRepositoryInterface
* @param Account $moveTo * @param Account $moveTo
* *
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
*/ */
public function destroy(Account $account, Account $moveTo): bool public function destroy(Account $account, Account $moveTo): bool
@ -161,6 +161,7 @@ class AccountRepository implements AccountRepositoryInterface
* @param array $data * @param array $data
* *
* @return Account * @return Account
*
* @throws FireflyException * @throws FireflyException
*/ */
public function store(array $data): Account public function store(array $data): Account
@ -222,7 +223,7 @@ class AccountRepository implements AccountRepositoryInterface
/** @var Transaction $transaction */ /** @var Transaction $transaction */
foreach ($journal->transactions as $transaction) { foreach ($journal->transactions as $transaction) {
$transaction->amount = bcmul($data['amount'], '-1'); $transaction->amount = bcmul($data['amount'], '-1');
if ($transaction->account->accountType->type === AccountType::ASSET) { if (AccountType::ASSET === $transaction->account->accountType->type) {
$transaction->amount = $data['amount']; $transaction->amount = $data['amount'];
} }
$transaction->save(); $transaction->save();
@ -413,6 +414,7 @@ class AccountRepository implements AccountRepositoryInterface
* @param string $name * @param string $name
* *
* @return Account * @return Account
*
* @throws FireflyException * @throws FireflyException
*/ */
protected function storeOpposingAccount(string $name): Account protected function storeOpposingAccount(string $name): Account
@ -511,6 +513,7 @@ class AccountRepository implements AccountRepositoryInterface
* @param array $data * @param array $data
* *
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
*/ */
protected function updateOpeningBalanceJournal(Account $account, TransactionJournal $journal, array $data): bool protected function updateOpeningBalanceJournal(Account $account, TransactionJournal $journal, array $data): bool

View File

@ -33,7 +33,6 @@ use Illuminate\Support\Collection;
*/ */
interface AccountRepositoryInterface interface AccountRepositoryInterface
{ {
/** /**
* Moved here from account CRUD. * Moved here from account CRUD.
* *

View File

@ -211,6 +211,7 @@ trait FindAccountsTrait
/** /**
* @return Account * @return Account
*
* @throws FireflyException * @throws FireflyException
*/ */
public function getCashAccount(): Account public function getCashAccount(): Account

View File

@ -43,6 +43,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface
* @param Attachment $attachment * @param Attachment $attachment
* *
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
*/ */
public function destroy(Attachment $attachment): bool public function destroy(Attachment $attachment): bool
@ -130,6 +131,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface
* @param Attachment $attachment * @param Attachment $attachment
* *
* @return string * @return string
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/ */
public function getContent(Attachment $attachment): string public function getContent(Attachment $attachment): string

View File

@ -48,6 +48,7 @@ class BillRepository implements BillRepositoryInterface
* @param Bill $bill * @param Bill $bill
* *
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
*/ */
public function destroy(Bill $bill): bool public function destroy(Bill $bill): bool
@ -391,6 +392,7 @@ class BillRepository implements BillRepositoryInterface
* @param Carbon $date * @param Carbon $date
* *
* @return \Carbon\Carbon * @return \Carbon\Carbon
*
* @throws \FireflyIII\Support\Facades\FireflyException * @throws \FireflyIII\Support\Facades\FireflyException
* @throws \FireflyIII\Support\Facades\FireflyException * @throws \FireflyIII\Support\Facades\FireflyException
*/ */
@ -430,6 +432,7 @@ class BillRepository implements BillRepositoryInterface
* @param Carbon $date * @param Carbon $date
* *
* @return Carbon * @return Carbon
*
* @throws \FireflyIII\Support\Facades\FireflyException * @throws \FireflyIII\Support\Facades\FireflyException
* @throws \FireflyIII\Support\Facades\FireflyException * @throws \FireflyIII\Support\Facades\FireflyException
* @throws \FireflyIII\Support\Facades\FireflyException * @throws \FireflyIII\Support\Facades\FireflyException
@ -616,10 +619,9 @@ class BillRepository implements BillRepositoryInterface
return $wordMatch; return $wordMatch;
} }
/** /**
* @param Bill $bill * @param Bill $bill
* @param string $note * @param string $note
* *
* @return bool * @return bool
*/ */

View File

@ -51,6 +51,7 @@ class BudgetRepository implements BudgetRepositoryInterface
/** /**
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
* @throws \Exception * @throws \Exception
*/ */
@ -125,6 +126,7 @@ class BudgetRepository implements BudgetRepositoryInterface
* @param Budget $budget * @param Budget $budget
* *
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
*/ */
public function destroy(Budget $budget): bool public function destroy(Budget $budget): bool
@ -607,6 +609,7 @@ class BudgetRepository implements BudgetRepositoryInterface
* @param string $amount * @param string $amount
* *
* @return BudgetLimit * @return BudgetLimit
*
* @throws \Exception * @throws \Exception
*/ */
public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): BudgetLimit public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): BudgetLimit

View File

@ -44,6 +44,7 @@ class CategoryRepository implements CategoryRepositoryInterface
* @param Category $category * @param Category $category
* *
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
*/ */
public function destroy(Category $category): bool public function destroy(Category $category): bool

View File

@ -53,6 +53,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface
/** /**
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
*/ */
public function cleanup(): bool public function cleanup(): bool
@ -138,6 +139,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface
* @param ExportJob $job * @param ExportJob $job
* *
* @return string * @return string
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/ */
public function getContent(ExportJob $job): string public function getContent(ExportJob $job): string

View File

@ -129,6 +129,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface
* @param null|UploadedFile $file * @param null|UploadedFile $file
* *
* @return bool * @return bool
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/ */
public function processFile(ImportJob $job, ?UploadedFile $file): bool public function processFile(ImportJob $job, ?UploadedFile $file): bool

View File

@ -42,6 +42,8 @@ use Log;
trait CreateJournalsTrait trait CreateJournalsTrait
{ {
/** /**
* Store accounts found in parent class.
*
* @param User $user * @param User $user
* @param TransactionType $type * @param TransactionType $type
* @param array $data * @param array $data
@ -78,6 +80,8 @@ trait CreateJournalsTrait
} }
/** /**
* Store a budget if found.
*
* @param Transaction $transaction * @param Transaction $transaction
* @param int $budgetId * @param int $budgetId
*/ */
@ -91,6 +95,8 @@ trait CreateJournalsTrait
} }
/** /**
* Store category if found.
*
* @param Transaction $transaction * @param Transaction $transaction
* @param string $category * @param string $category
*/ */
@ -161,6 +167,8 @@ trait CreateJournalsTrait
} }
/** /**
* Store a transaction.
*
* @param array $data * @param array $data
* *
* @return Transaction * @return Transaction
@ -202,6 +210,8 @@ trait CreateJournalsTrait
} }
/** /**
* Update note for journal.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* @param string $note * @param string $note
* *

View File

@ -99,6 +99,7 @@ class JournalRepository implements JournalRepositoryInterface
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
*/ */
public function delete(TransactionJournal $journal): bool public function delete(TransactionJournal $journal): bool
@ -180,7 +181,7 @@ class JournalRepository implements JournalRepositoryInterface
{ {
/** @var Transaction $transaction */ /** @var Transaction $transaction */
foreach ($journal->transactions as $transaction) { foreach ($journal->transactions as $transaction) {
if ($transaction->account->accountType->type === AccountType::ASSET) { if (AccountType::ASSET === $transaction->account->accountType->type) {
return $transaction; return $transaction;
} }
} }
@ -274,6 +275,7 @@ class JournalRepository implements JournalRepositoryInterface
* @param array $data * @param array $data
* *
* @return TransactionJournal * @return TransactionJournal
*
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
*/ */
@ -361,6 +363,7 @@ class JournalRepository implements JournalRepositoryInterface
* @param array $data * @param array $data
* *
* @return TransactionJournal * @return TransactionJournal
*
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
* @throws \FireflyIII\Exceptions\FireflyException * @throws \FireflyIII\Exceptions\FireflyException
@ -418,7 +421,6 @@ class JournalRepository implements JournalRepositoryInterface
return $journal; return $journal;
} }
/** /**
* Same as above but for transaction journal with multiple transactions. * Same as above but for transaction journal with multiple transactions.
* *

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Repositories\Journal; namespace FireflyIII\Repositories\Journal;

View File

@ -119,6 +119,7 @@ trait SupportJournalsTrait
* @param array $data * @param array $data
* *
* @return array * @return array
*
* @throws FireflyException * @throws FireflyException
* @throws FireflyException * @throws FireflyException
*/ */
@ -167,6 +168,7 @@ trait SupportJournalsTrait
* @param array $data * @param array $data
* *
* @return array * @return array
*
* @throws FireflyException * @throws FireflyException
* @throws FireflyException * @throws FireflyException
*/ */

View File

@ -71,6 +71,8 @@ trait UpdateJournalsTrait
} }
/** /**
* Update destination transaction.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* @param Account $account * @param Account $account
* @param array $data * @param array $data
@ -94,6 +96,8 @@ trait UpdateJournalsTrait
} }
/** /**
* Update source transaction.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* @param Account $account * @param Account $account
* @param array $data * @param array $data
@ -118,6 +122,8 @@ trait UpdateJournalsTrait
} }
/** /**
* Update tags.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* @param array $array * @param array $array
* *

View File

@ -51,6 +51,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
* @param LinkType $moveTo * @param LinkType $moveTo
* *
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
*/ */
public function destroy(LinkType $linkType, LinkType $moveTo): bool public function destroy(LinkType $linkType, LinkType $moveTo): bool
@ -67,6 +68,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
* @param TransactionJournalLink $link * @param TransactionJournalLink $link
* *
* @return bool * @return bool
*
* @throws \Exception * @throws \Exception
*/ */
public function destroyLink(TransactionJournalLink $link): bool public function destroyLink(TransactionJournalLink $link): bool

Some files were not shown because too many files have changed in this diff Show More