Skip to content

Commit

Permalink
Clean up, fix phpstan error
Browse files Browse the repository at this point in the history
  • Loading branch information
Khadreal committed Feb 12, 2025
1 parent c4a48cb commit 719adef
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AbstractQueries extends Query {
*
* @var int
*/
protected $cleanup_interval;
public $cleanup_interval;

/**
* Table status.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function delete_old_rows() {
return false;
}

$delete_interval = $this->cleanup_interval ?? 1;
$delete_interval = $this->cleanup_interval;

$prefixed_table_name = $db->prefix . $this->table_name;
$query = "DELETE FROM `$prefixed_table_name` WHERE status = 'failed' OR `last_accessed` <= date_sub(now(), interval $delete_interval month)";
Expand Down
2 changes: 1 addition & 1 deletion inc/Engine/Media/AboveTheFold/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function queries(): QueriesInterface {
return $this->queries;
}

return $this->queries->set_cleanup_interval( $delete_interval );
return $this->queries->set_cleanup_interval( $delete_interval ); // @phpstan-ignore-line
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function delete_old_rows() {
return false;
}

$delete_interval = $this->cleanup_interval ?? 1;
$delete_interval = $this->cleanup_interval;

$prefixed_table_name = $db->prefix . $this->table_name;
$query = "DELETE FROM `$prefixed_table_name` WHERE status = 'failed' OR `last_accessed` <= date_sub(now(), interval $delete_interval month)";
Expand Down

0 comments on commit 719adef

Please sign in to comment.