mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
apply rector rules: php up to php82
This commit is contained in:
@@ -15,7 +15,7 @@ use DateTimeImmutable;
|
||||
|
||||
class RollingDate
|
||||
{
|
||||
public const ALL_T = [
|
||||
final public const ALL_T = [
|
||||
self::T_YEAR_PREVIOUS_START,
|
||||
self::T_QUARTER_PREVIOUS_START,
|
||||
self::T_MONTH_PREVIOUS_START,
|
||||
@@ -35,47 +35,43 @@ class RollingDate
|
||||
/**
|
||||
* A given fixed date.
|
||||
*/
|
||||
public const T_FIXED_DATE = 'fixed_date';
|
||||
final public const T_FIXED_DATE = 'fixed_date';
|
||||
|
||||
public const T_MONTH_CURRENT_START = 'month_current_start';
|
||||
final public const T_MONTH_CURRENT_START = 'month_current_start';
|
||||
|
||||
public const T_MONTH_NEXT_START = 'month_next_start';
|
||||
final public const T_MONTH_NEXT_START = 'month_next_start';
|
||||
|
||||
public const T_MONTH_PREVIOUS_START = 'month_previous_start';
|
||||
final public const T_MONTH_PREVIOUS_START = 'month_previous_start';
|
||||
|
||||
public const T_QUARTER_CURRENT_START = 'quarter_current_start';
|
||||
final public const T_QUARTER_CURRENT_START = 'quarter_current_start';
|
||||
|
||||
public const T_QUARTER_NEXT_START = 'quarter_next_start';
|
||||
final public const T_QUARTER_NEXT_START = 'quarter_next_start';
|
||||
|
||||
public const T_QUARTER_PREVIOUS_START = 'quarter_previous_start';
|
||||
final public const T_QUARTER_PREVIOUS_START = 'quarter_previous_start';
|
||||
|
||||
public const T_TODAY = 'today';
|
||||
final public const T_TODAY = 'today';
|
||||
|
||||
public const T_WEEK_CURRENT_START = 'week_current_start';
|
||||
final public const T_WEEK_CURRENT_START = 'week_current_start';
|
||||
|
||||
public const T_WEEK_NEXT_START = 'week_next_start';
|
||||
final public const T_WEEK_NEXT_START = 'week_next_start';
|
||||
|
||||
public const T_WEEK_PREVIOUS_START = 'week_previous_start';
|
||||
final public const T_WEEK_PREVIOUS_START = 'week_previous_start';
|
||||
|
||||
public const T_YEAR_CURRENT_START = 'year_current_start';
|
||||
final public const T_YEAR_CURRENT_START = 'year_current_start';
|
||||
|
||||
public const T_YEAR_NEXT_START = 'year_next_start';
|
||||
final public const T_YEAR_NEXT_START = 'year_next_start';
|
||||
|
||||
public const T_YEAR_PREVIOUS_START = 'year_previous_start';
|
||||
|
||||
/**
|
||||
* The pivot date is the date from the rolling is computed. By default, it is "now".
|
||||
*/
|
||||
private DateTimeImmutable $pivotDate;
|
||||
final public const T_YEAR_PREVIOUS_START = 'year_previous_start';
|
||||
|
||||
/**
|
||||
* @param string|self::T_* $roll
|
||||
* @param DateTimeImmutable|null $pivotDate Will be "now" if null is given
|
||||
* @param DateTimeImmutable|null $fixedDate Only to insert if $roll equals @see{self::T_FIXED_DATE}
|
||||
*/
|
||||
public function __construct(private string $roll, private ?\DateTimeImmutable $fixedDate = null, ?DateTimeImmutable $pivotDate = null)
|
||||
{
|
||||
$this->pivotDate = $pivotDate ?? new DateTimeImmutable('now');
|
||||
public function __construct(
|
||||
private readonly string $roll,
|
||||
private readonly ?\DateTimeImmutable $fixedDate = null,
|
||||
private readonly DateTimeImmutable $pivotDate = new DateTimeImmutable('now')
|
||||
) {
|
||||
}
|
||||
|
||||
public function getFixedDate(): ?DateTimeImmutable
|
||||
|
Reference in New Issue
Block a user