Various code cleanup.

This commit is contained in:
James Cole
2017-12-22 18:32:43 +01:00
parent f13a93348f
commit 8bd76d1ff0
188 changed files with 383 additions and 396 deletions

View File

@@ -41,40 +41,14 @@ class BillLine
/** @var string */
protected $min;
/** @var Carbon */
private $endOfPayDate;
/** @var Carbon */
private $lastHitDate;
/** @var Carbon */
private $payDate;
/** @var Carbon */
private $endOfPayDate;
/** @var int */
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.
*/
@@ -115,6 +89,22 @@ class BillLine
$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
*/
@@ -163,6 +153,22 @@ class BillLine
$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
*/
@@ -202,12 +208,4 @@ class BillLine
{
$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;
/**
* @param Collection $accounts
*
* @return JournalCollectorInterface
*/
public function setOpposingAccounts(Collection $accounts): JournalCollectorInterface;
/**
* @param Collection $accounts
*
@@ -167,6 +160,13 @@ interface JournalCollectorInterface
*/
public function setOffset(int $offset): JournalCollectorInterface;
/**
* @param Collection $accounts
*
* @return JournalCollectorInterface
*/
public function setOpposingAccounts(Collection $accounts): JournalCollectorInterface;
/**
* @param int $page
*

View File

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

View File

@@ -79,12 +79,12 @@ class ReportHelper implements ReportHelperInterface
/** @var Bill $bill */
foreach ($bills as $bill) {
$expectedDates = $repository->getPayDatesInRange($bill, $start, $end);
foreach($expectedDates as $payDate) {
foreach ($expectedDates as $payDate) {
$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);
$journals = $collector->getJournals();
$journals = $collector->getJournals();
$billLine = new BillLine;
$billLine->setBill($bill);