Menu

## IntervalStep

IntervalStep.php : 24

### Table of Contents

#### Properties

$step : Closure|null
  Step to apply instead of a fixed interval to get the new date.

#### Methods

convertDate() : CarbonInterface
  Take a date and apply either the step if set, or the current interval else.
getStep() : Closure
  Get the dynamic step in use.
setStep() : void
  Set a step to apply instead of a fixed interval to get the new date.
resolveCarbon() : Carbon|CarbonImmutable
  Convert DateTimeImmutable instance to CarbonImmutable instance and DateTime instance to Carbon instance.

### Properties

#### $step

IntervalStep.php : 31

Step to apply instead of a fixed interval to get the new date.

`protected Closure|null $step`

### Methods

#### convertDate()

IntervalStep.php : 65

Take a date and apply either the step if set, or the current interval else.

`public convertDate(DateTimeInterface $dateTime[, bool $negated = false ]) : CarbonInterface`

The interval/step is applied negatively (typically subtraction instead of addition) if $negated is true.

##### Parameters

$dateTime : DateTimeInterface
$negated : bool = false

##### Return values

CarbonInterface

#### getStep()

IntervalStep.php : 38

Get the dynamic step in use.

`public getStep() : Closure`

##### Return values

Closure

#### setStep()

IntervalStep.php : 50

Set a step to apply instead of a fixed interval to get the new date.

`public setStep(Closure|null $step) : void`

Or pass null to switch to fixed interval.

##### Parameters

$step : Closure|null

#### resolveCarbon()

IntervalStep.php : 86

Convert DateTimeImmutable instance to CarbonImmutable instance and DateTime instance to Carbon instance.

`private resolveCarbon(DateTimeInterface $dateTime) : Carbon|CarbonImmutable`

##### Parameters

$dateTime : DateTimeInterface

##### Return values

Carbon|CarbonImmutable

## Search results