Clean up various code.

This commit is contained in:
James Cole
2023-12-22 17:28:42 +01:00
parent e8890ada7c
commit 067d160c13
33 changed files with 331 additions and 699 deletions

View File

@@ -49,6 +49,9 @@ class ConvertToTransfer implements ActionInterface
$this->action = $action;
}
/**
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function actOnArray(array $journal): bool
{
// make object from array (so the data is fresh).
@@ -162,7 +165,7 @@ class ConvertToTransfer implements ActionInterface
return '';
}
return (string)$journal->transactions()->where('amount', '<', 0)->first()?->account?->accountType?->type;
return (string) $journal->transactions()->where('amount', '<', 0)->first()?->account?->accountType?->type;
}
private function getDestinationType(int $journalId): string
@@ -175,7 +178,7 @@ class ConvertToTransfer implements ActionInterface
return '';
}
return (string)$journal->transactions()->where('amount', '>', 0)->first()?->account?->accountType?->type;
return (string) $journal->transactions()->where('amount', '>', 0)->first()?->account?->accountType?->type;
}
/**