mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Improve code quality and add documentation in folder "Generator"
This commit is contained in:
@@ -32,15 +32,18 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
class MonthReportGenerator implements ReportGeneratorInterface
|
||||
{
|
||||
/** @var Collection */
|
||||
/** @var Collection The accounts involved in the report. */
|
||||
private $accounts;
|
||||
/** @var Carbon */
|
||||
/** @var Carbon The end date. */
|
||||
private $end;
|
||||
/** @var Carbon */
|
||||
/** @var Carbon The start date. */
|
||||
private $start;
|
||||
|
||||
/**
|
||||
* Generates the report.
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
@@ -58,6 +61,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the accounts involved in the report.
|
||||
*
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -70,6 +75,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused budget setter.
|
||||
*
|
||||
* @param Collection $budgets
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -80,6 +87,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused category setter.
|
||||
*
|
||||
* @param Collection $categories
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -90,6 +99,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the end date of the report.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -102,6 +113,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the expenses used in this report.
|
||||
*
|
||||
* @param Collection $expense
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -112,6 +125,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the start date of this report.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -124,6 +139,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the tags used in this report.
|
||||
*
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
|
@@ -31,15 +31,18 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
{
|
||||
/** @var Collection */
|
||||
/** @var Collection The accounts involved. */
|
||||
private $accounts;
|
||||
/** @var Carbon */
|
||||
/** @var Carbon The end date. */
|
||||
private $end;
|
||||
/** @var Carbon */
|
||||
/** @var Carbon The start date. */
|
||||
private $start;
|
||||
|
||||
/**
|
||||
* Generates the report.
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
@@ -55,6 +58,8 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the accounts used in the report.
|
||||
*
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -67,6 +72,8 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the budgets used in the report.
|
||||
*
|
||||
* @param Collection $budgets
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -77,6 +84,8 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the categories used in the report.
|
||||
*
|
||||
* @param Collection $categories
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -87,6 +96,8 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the end date used in the report.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -99,6 +110,8 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused setter for expenses.
|
||||
*
|
||||
* @param Collection $expense
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -109,6 +122,8 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the start date of the report.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -121,6 +136,8 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the tags for the report.
|
||||
*
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
|
@@ -31,15 +31,18 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
class YearReportGenerator implements ReportGeneratorInterface
|
||||
{
|
||||
/** @var Collection */
|
||||
/** @var Collection The accounts involved. */
|
||||
private $accounts;
|
||||
/** @var Carbon */
|
||||
/** @var Carbon The end date. */
|
||||
private $end;
|
||||
/** @var Carbon */
|
||||
/** @var Carbon The start date. */
|
||||
private $start;
|
||||
|
||||
/**
|
||||
* Generates the report.
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
@@ -55,6 +58,8 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the accounts.
|
||||
*
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -67,6 +72,8 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused budget setter.
|
||||
*
|
||||
* @param Collection $budgets
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -77,6 +84,8 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused categories setter.
|
||||
*
|
||||
* @param Collection $categories
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -87,6 +96,8 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the end date.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -99,6 +110,8 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the expenses used.
|
||||
*
|
||||
* @param Collection $expense
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -109,6 +122,8 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the start date.
|
||||
*
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
@@ -121,6 +136,8 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused tags setter.
|
||||
*
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
|
Reference in New Issue
Block a user