Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jc - fixing linting errors #901

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions client-mu-plugins/goodbids/src/classes/Auctions/Auctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Auctions {
* @since 1.0.0
* @var string
*/
const CRON_AUCTION_ENDING_SOON_CHECK_HOOK = 'goodbids_auction_ending_soon_event'
const CRON_AUCTION_ENDING_SOON_CHECK_HOOK = 'goodbids_auction_ending_soon_event';

/**
* @since 1.0.0
Expand Down Expand Up @@ -426,7 +426,7 @@ public function get_auctions_ending_soon($threshold_start, $threshold_end): arra
'compare'=>'<='
],
]
]
];
$ending_soon = $this->get_all( $query_args );

return $ending_soon-> posts;
Expand All @@ -441,13 +441,16 @@ public function get_auctions_ending_soon($threshold_start, $threshold_end): arra
* @return array
*/
public function get_auctions_ending_soon_emails(): array {
$threshold_start = new DateTime()->modify('+3 hours') // TODO update to dynamic values (1/3 of auction extension window)
$threshold_end = new DateTime()->modify('+4 hours') // TODO update to dynamic values (1/3 of auction extension window)
$threshold_start = new DateTime(); // Create a new DateTime object with the current time
$threshold_start->modify('+3 hours'); // Modify the DateTime object by adding 3 hours
$threshold_end = new DateTime(); // Create a new DateTime object with the current time
$threshold_end->modify('+4 hours'); // Modify the DateTime object by adding 3 hours

$ending_soon_emails = [];

$ending_soon = $this->get_auctions_ending_soon($threshold_start, $threshold_end)
$ending_soon = $this->get_auctions_ending_soon($threshold_start, $threshold_end);

if (count($ending_soon)){
if (count($ending_soon)) {
array_push( $ending_soon_emails, ...$ending_soon );
}
return $ending_soon_emails;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function (): void {
$this->send_to_watchers( $auction );
}
}
)
);
}

/**
Expand Down