: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Yoast\WP\SEO\Promotions\Domain;
* Value object for a time interval.
* The starting time of the interval as a Unix timestamp.
* The ending time of the interval as a Unix timestamp.
* Time_Interval constructor.
* @param int $time_start Interval start time.
* @param int $time_end Interval end time.
public function __construct( int $time_start, int $time_end ) {
$this->time_start = $time_start;
$this->time_end = $time_end;
* Checks if the given time is within the interval.
* @param int $time The time to check.
* @return bool Whether the given time is within the interval.
public function contains( int $time ): bool {
return ( ( $time > $this->time_start ) && ( $time < $this->time_end ) );
* Sets the interval astarting date.
* @param int $time_start The interval start time.
public function set_start_date( int $time_start ) {
$this->time_start = $time_start;
* Sets the interval ending date.
* @param int $time_end The interval end time.
public function set_end_date( int $time_end ) {
$this->time_end = $time_end;