Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordpres.../src/promotio.../domain
File: time-interval.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Promotions\Domain;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Class Time_Interval
[5] Fix | Delete
*
[6] Fix | Delete
* Value object for a time interval.
[7] Fix | Delete
*/
[8] Fix | Delete
class Time_Interval {
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* The starting time of the interval as a Unix timestamp.
[12] Fix | Delete
*
[13] Fix | Delete
* @var int
[14] Fix | Delete
*/
[15] Fix | Delete
public $time_start;
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* The ending time of the interval as a Unix timestamp.
[19] Fix | Delete
*
[20] Fix | Delete
* @var int
[21] Fix | Delete
*/
[22] Fix | Delete
public $time_end;
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* Time_Interval constructor.
[26] Fix | Delete
*
[27] Fix | Delete
* @codeCoverageIgnore
[28] Fix | Delete
*
[29] Fix | Delete
* @param int $time_start Interval start time.
[30] Fix | Delete
* @param int $time_end Interval end time.
[31] Fix | Delete
*/
[32] Fix | Delete
public function __construct( int $time_start, int $time_end ) {
[33] Fix | Delete
$this->time_start = $time_start;
[34] Fix | Delete
$this->time_end = $time_end;
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Checks if the given time is within the interval.
[39] Fix | Delete
*
[40] Fix | Delete
* @param int $time The time to check.
[41] Fix | Delete
*
[42] Fix | Delete
* @return bool Whether the given time is within the interval.
[43] Fix | Delete
*/
[44] Fix | Delete
public function contains( int $time ): bool {
[45] Fix | Delete
return ( ( $time > $this->time_start ) && ( $time < $this->time_end ) );
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
/**
[49] Fix | Delete
* Sets the interval astarting date.
[50] Fix | Delete
*
[51] Fix | Delete
* @param int $time_start The interval start time.
[52] Fix | Delete
*
[53] Fix | Delete
* @return void
[54] Fix | Delete
*/
[55] Fix | Delete
public function set_start_date( int $time_start ) {
[56] Fix | Delete
$this->time_start = $time_start;
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Sets the interval ending date.
[61] Fix | Delete
*
[62] Fix | Delete
* @param int $time_end The interval end time.
[63] Fix | Delete
*
[64] Fix | Delete
* @return void
[65] Fix | Delete
*/
[66] Fix | Delete
public function set_end_date( int $time_end ) {
[67] Fix | Delete
$this->time_end = $time_end;
[68] Fix | Delete
}
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function