Some cleaning up and suppressing.

This commit is contained in:
James Cole
2016-01-15 20:48:06 +01:00
parent 31533b5ef8
commit 51062bc80b
4 changed files with 16 additions and 12 deletions
@@ -323,6 +323,8 @@ class JournalRepository implements JournalRepositoryInterface
* @param array $data
*
* @return array
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
protected function storeAccounts(TransactionType $type, array $data)
{
+4 -4
View File
@@ -318,6 +318,8 @@ class TagRepository implements TagRepositoryInterface
* @param TransactionJournal $journal
* @param Tag $tag
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
* @return boolean
*/
protected function connectAdvancePayment(TransactionJournal $journal, Tag $tag)
@@ -332,13 +334,11 @@ class TagRepository implements TagRepositoryInterface
$withdrawals = $tag->transactionjournals()->where('transaction_type_id', $withdrawal->id)->count();
$deposits = $tag->transactionjournals()->where('transaction_type_id', $deposit->id)->count();
// advance payments cannot accept transfers:
if ($journal->transaction_type_id == $transfer->id) {
if ($journal->transaction_type_id == $transfer->id) { // advance payments cannot accept transfers:
return false;
}
// the first transaction to be attached to this
// tag is attached just like that:
// the first transaction to be attached to this tag is attached just like that:
if ($withdrawals < 1 && $deposits < 1) {
$journal->tags()->save($tag);
$journal->save();