mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
chore: reformat code.
This commit is contained in:
@@ -51,7 +51,7 @@ class WarnAboutBills implements ShouldQueue
|
||||
* Create a new job instance.
|
||||
*
|
||||
*
|
||||
* @param Carbon|null $date
|
||||
* @param Carbon|null $date
|
||||
*/
|
||||
public function __construct(?Carbon $date)
|
||||
{
|
||||
@@ -96,37 +96,7 @@ class WarnAboutBills implements ShouldQueue
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $date
|
||||
*/
|
||||
public function setDate(Carbon $date): void
|
||||
{
|
||||
$newDate = clone $date;
|
||||
$newDate->startOfDay();
|
||||
$this->date = $newDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $force
|
||||
*/
|
||||
public function setForce(bool $force): void
|
||||
{
|
||||
$this->force = $force;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param string $field
|
||||
* @return int
|
||||
*/
|
||||
private function getDiff(Bill $bill, string $field): int
|
||||
{
|
||||
$today = clone $this->date;
|
||||
$carbon = clone $bill->$field;
|
||||
return $today->diffInDays($carbon, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param Bill $bill
|
||||
* @return bool
|
||||
*/
|
||||
private function hasDateFields(Bill $bill): bool
|
||||
@@ -143,8 +113,8 @@ class WarnAboutBills implements ShouldQueue
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param string $field
|
||||
* @param Bill $bill
|
||||
* @param string $field
|
||||
* @return bool
|
||||
*/
|
||||
private function needsWarning(Bill $bill, string $field): bool
|
||||
@@ -162,8 +132,20 @@ class WarnAboutBills implements ShouldQueue
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param string $field
|
||||
* @param Bill $bill
|
||||
* @param string $field
|
||||
* @return int
|
||||
*/
|
||||
private function getDiff(Bill $bill, string $field): int
|
||||
{
|
||||
$today = clone $this->date;
|
||||
$carbon = clone $bill->$field;
|
||||
return $today->diffInDays($carbon, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param string $field
|
||||
* @return void
|
||||
*/
|
||||
private function sendWarning(Bill $bill, string $field): void
|
||||
@@ -172,4 +154,22 @@ class WarnAboutBills implements ShouldQueue
|
||||
Log::debug('Will now send warning!');
|
||||
event(new WarnUserAboutBill($bill, $field, $diff));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $date
|
||||
*/
|
||||
public function setDate(Carbon $date): void
|
||||
{
|
||||
$newDate = clone $date;
|
||||
$newDate->startOfDay();
|
||||
$this->date = $newDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $force
|
||||
*/
|
||||
public function setForce(bool $force): void
|
||||
{
|
||||
$this->force = $force;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user