chore: reformat code.

This commit is contained in:
James Cole
2023-06-21 12:34:58 +02:00
parent 8d87abde64
commit 3dcb35710b
799 changed files with 23319 additions and 22173 deletions

View File

@@ -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;
}
}