From 687da83febac9b5b2aca374a9876dab9f6be83b0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 6 Dec 2016 09:09:05 +0100 Subject: [PATCH] Remove unused collections [skip ci] --- app/Helpers/Collection/Expense.php | 85 ------------------------------ app/Helpers/Collection/Income.php | 81 ---------------------------- 2 files changed, 166 deletions(-) delete mode 100644 app/Helpers/Collection/Expense.php delete mode 100644 app/Helpers/Collection/Income.php diff --git a/app/Helpers/Collection/Expense.php b/app/Helpers/Collection/Expense.php deleted file mode 100644 index 7a06e4f628..0000000000 --- a/app/Helpers/Collection/Expense.php +++ /dev/null @@ -1,85 +0,0 @@ -expenses = new Collection; - } - - /** - * @param stdClass $entry - */ - public function addOrCreateExpense(stdClass $entry) - { - $this->expenses->put($entry->id, $entry); - } - - /** - * @param string $add - */ - public function addToTotal(string $add) - { - $add = strval(round($add, 2)); - if (bccomp('0', $add) === -1) { - $add = bcmul($add, '-1'); - } - - // if amount is positive, the original transaction - // was a transfer. But since this is an expense report, - // that amount must be negative. - - $this->total = bcadd($this->total, $add); - } - - /** - * @return Collection - */ - public function getExpenses(): Collection - { - $set = $this->expenses->sortBy( - function (stdClass $object) { - return $object->amount; - } - ); - - return $set; - } - - /** - * @return string - */ - public function getTotal(): string - { - return strval(round($this->total, 2)); - } -} diff --git a/app/Helpers/Collection/Income.php b/app/Helpers/Collection/Income.php deleted file mode 100644 index 1bd6036150..0000000000 --- a/app/Helpers/Collection/Income.php +++ /dev/null @@ -1,81 +0,0 @@ -incomes = new Collection; - } - - /** - * @param stdClass $entry - */ - public function addOrCreateIncome(stdClass $entry) - { - $this->incomes->put($entry->id, $entry); - - } - - /** - * @param string $add - */ - public function addToTotal(string $add) - { - $add = strval(round($add, 2)); - $this->total = bcadd($this->total, $add); - } - - /** - * @return Collection - */ - public function getIncomes(): Collection - { - $set = $this->incomes->sortByDesc( - function (stdClass $object) { - return $object->amount; - } - ); - - return $set; - } - - /** - * @return string - */ - public function getTotal(): string - { - return strval(round($this->total, 2)); - } - - -}