Index

Interval

MMO\math\helpers · 1 symbol · generated 30 Sep 2026

class

Interval

Interval.php:11
class MMO\math\helpers\Interval implements MMO\math\interfaces\iDomain, IteratorAggregate, Stringable
Namespace
MMO\math\helpers
Implements
iDomain, IteratorAggregate, Stringable

Constants10

CONTAIN

const CONTAIN = 9

END_AFTER

const END_AFTER = 8

END_BEFORE

const END_BEFORE = 2

INSIDE

const INSIDE = 0

LEFT

const LEFT = 3

LEFT_OVERFLOW

const LEFT_OVERFLOW = 1

RIGHT

const RIGHT = 12

RIGHT_OVERFLOW

const RIGHT_OVERFLOW = 8

START_AFTER

const START_AFTER = 4

START_BEFORE

const START_BEFORE = 1

Properties5

end

readonly
readonly float $end
Type
float

includeEnd

readonly
readonly bool $includeEnd
Type
bool

includeStart

readonly
readonly bool $includeStart
Type
bool

start

readonly
readonly float $start
Type
float

Methods36

computeLeft($operator, $value)

Interval.php:325

Do an operation on the start and end of this interval using the value at the start of the computing ($value * $this)

function computeLeft(callable $operator, self|int|float $value): static
$operatorcallablefn($a,$b): int|float|null
$valueself | int | float
returnsstatic

computeRight($operator, $value)

Interval.php:336

Do an operation on the start and end of this interval using the value at the end of the computing ($this * $value)

function computeRight(callable $operator, self|int|float $value): static
$operatorcallablefn($a,$b): int|float|null
$valueself | int | float
returnsstatic

FromDates($start, $end, $ignoreTime, $includeStart, $includeEnd)

staticInterval.php:69

Create an interval from dates

static function FromDates( ?DateTimeInterface $start, ?DateTimeInterface $end, bool $ignoreTime = false, bool $includeStart = true, bool $includeEnd = true ): self
$startnull | DateTimeInterface
$endnull | DateTimeInterface
$ignoreTime = falseboolif true, start's time is set to 00:00:00 and end's time to 23:59:59
$includeStart = truebool
$includeEnd = truebool
returnsself

FromValue($value, $isIncluded)

staticInterval.php:56
static function FromValue(float $value, bool $isIncluded = true): self
$valuefloat
$isIncluded = truebool
returnsself

getIterator($step, $scale, $reverse)

Interval.php:117
function getIterator(int|float $step = 1, ?int $scale = null, bool $reverse = false): MMO\math\iterators\DomainIterator
$step = 1int | float
$scale = nullnull | int
$reverse = falsebool
returnsDomainIterator

normalize()

Interval.php:315

Get a normal vector from this interval (start at 0, with a length of [0,1])

function normalize(): self
returnsself

__construct($start, $end, $includeStart, $includeEnd)

Interval.php:32
function __construct( float $start, float $end, bool $includeStart = true, bool $includeEnd = true )
$startfloat
$endfloat
$includeStart = truebool
$includeEnd = truebool