Documentation

Range
in package
uses CloneWith

FinalYes

Range represents a set of integer values, used to match fields of a calendar time in StructuredCalendarSpec.

If end < start, then end is interpreted as equal to start. This means you can use a Range with start set to a value, and end and step unset (defaulting to 0) to represent a single value.

Tags
see
Range

Table of Contents

Properties

$end  : int
$start  : int
$step  : int

Methods

new()  : self
withEnd()  : self
withStart()  : self
withStep()  : self
__construct()  : mixed

Properties

$end read-only

public int $end

$start read-only

public int $start

$step read-only

public int $step

Methods

new()

public static new(int $start, int $end[, int $step = 1 ]) : self
Parameters
$start : int

Start of range (inclusive).

$end : int

End of range (inclusive).

$step : int = 1

Step (optional, default 1).

Return values
self

withEnd()

public withEnd(int $end) : self
Parameters
$end : int

End of range (inclusive).

Return values
self

withStart()

public withStart(int $start) : self
Parameters
$start : int

Start of range (inclusive).

Return values
self

withStep()

public withStep(positive-int $step) : self
Parameters
$step : positive-int

Step (optional, default 1).

Return values
self

__construct()

private __construct(int $start, int $end, int $step) : mixed
Parameters
$start : int

Start of range (inclusive).

$end : int

End of range (inclusive).

$step : int

Step (optional, default 1).


        
On this page

Search results