Add PHP_CodeSniffer, lint code

This commit is contained in:
Ben Goldsworthy 2022-11-30 12:47:09 -06:00
parent 172131e1e6
commit ddf235a61b
8 changed files with 188 additions and 68 deletions

View file

@ -49,32 +49,32 @@ class Digest extends Mailable
$cutoffDateTime = new DateTime();
switch ($this->digest_type) {
case 'daily':
$cutoffDateTime->modify('-1 day');
break;
case 'weekly':
$cutoffDateTime->modify('-1 week');
break;
case 'fortnightly':
$cutoffDateTime->modify('-2 weeks');
break;
case 'monthly':
$cutoffDateTime->modify('-1 month');
break;
default:
case 'daily':
$cutoffDateTime->modify('-1 day');
break;
case 'weekly':
$cutoffDateTime->modify('-1 week');
break;
case 'fortnightly':
$cutoffDateTime->modify('-2 weeks');
break;
case 'monthly':
$cutoffDateTime->modify('-1 month');
break;
default:
}
$this->locations = array_filter(
$trip->locations,
function($elem) use ($cutoffDateTime) {
$trip->locations,
function ($elem) use ($cutoffDateTime) {
$elemDateTime = new DateTime($elem->created_at);
return $elemDateTime > $cutoffDateTime;
}
);
$this->checkinsList = array_filter(
$trip->checkinsList,
function($elem) use ($cutoffDateTime) {
$trip->checkinsList,
function ($elem) use ($cutoffDateTime) {
$elemDateTime = new DateTime($elem->created_at);
return $elemDateTime > $cutoffDateTime;
}