mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 14:48:11 +00:00
Code cleanup.
This commit is contained in:
@@ -82,16 +82,14 @@ class ConvertController extends Controller
|
||||
$subTitle = (string)trans('firefly.convert_to_' . $destinationType->type, ['description' => $journal->description]);
|
||||
$subTitleIcon = 'fa-exchange';
|
||||
|
||||
// cannot convert to its own type.
|
||||
if ($sourceType->type === $destinationType->type) {
|
||||
if ($sourceType->type === $destinationType->type) { // cannot convert to its own type.
|
||||
Log::debug('This is already a transaction of the expected type..');
|
||||
session()->flash('info', (string)trans('firefly.convert_is_already_type_' . $destinationType->type));
|
||||
|
||||
return redirect(route('transactions.show', [$journal->id]));
|
||||
}
|
||||
|
||||
// cannot convert split.
|
||||
if ($journal->transactions()->count() > 2) {
|
||||
if ($journal->transactions()->count() > 2) { // cannot convert split.
|
||||
Log::info('This journal has more than two transactions.');
|
||||
session()->flash('error', (string)trans('firefly.cannot_convert_split_journal'));
|
||||
|
||||
@@ -119,7 +117,8 @@ class ConvertController extends Controller
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws FireflyException
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
public function postIndex(Request $request, TransactionType $destinationType, TransactionJournal $journal)
|
||||
{
|
||||
@@ -172,6 +171,9 @@ class ConvertController extends Controller
|
||||
* @return Account
|
||||
*
|
||||
* @throws FireflyException
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
private function getDestinationAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account
|
||||
{
|
||||
@@ -228,6 +230,9 @@ class ConvertController extends Controller
|
||||
* @return Account
|
||||
*
|
||||
* @throws FireflyException
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
private function getSourceAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user