mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 20:22:07 +00:00
Small code quality improvements.
This commit is contained in:
@@ -29,6 +29,7 @@ use FireflyIII\Models\PiggyBank;
|
||||
use FireflyIII\Models\PiggyBankEvent;
|
||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use FireflyIII\Support\Http\Controllers\DateCalculation;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
@@ -37,6 +38,7 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
class PiggyBankController extends Controller
|
||||
{
|
||||
use DateCalculation;
|
||||
/** @var GeneratorInterface */
|
||||
protected $generator;
|
||||
|
||||
@@ -81,17 +83,7 @@ class PiggyBankController extends Controller
|
||||
$oldest = $startDate->lt($firstDate) ? $startDate : $firstDate;
|
||||
$today = new Carbon;
|
||||
// depending on diff, do something with range of chart.
|
||||
$step = '1D';
|
||||
$months = $oldest->diffInMonths($today);
|
||||
if ($months > 3) {
|
||||
$step = '1W'; // @codeCoverageIgnore
|
||||
}
|
||||
if ($months > 24) {
|
||||
$step = '1M'; // @codeCoverageIgnore
|
||||
}
|
||||
if ($months > 100) {
|
||||
$step = '1Y'; // @codeCoverageIgnore
|
||||
}
|
||||
$step = $this->calculateStep($oldest, $today);
|
||||
|
||||
$chartData = [];
|
||||
while ($oldest <= $today) {
|
||||
|
Reference in New Issue
Block a user