MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

Interval

MMO\math\helpers · 1 symbole · générée le 27 Oct 2026

class

Interval

Interval.php:11
class MMO\math\helpers\Interval implements MMO\math\interfaces\iDomain, IteratorAggregate, Stringable
Espace de noms
MMO\math\helpers
Implémente
iDomain, IteratorAggregate, Stringable

Index

Constantes10

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

Propriétés5

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

Méthodes37

computeLeft($operator, $value)

Interval.php:337

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
retournestatic

computeRight($operator, $value)

Interval.php:348

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
retournestatic

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
retourneself

FromValue($value, $isIncluded)

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

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
retourneDomainIterator

normalize()

Interval.php:327

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

function normalize(): self
retourneself

touches($value)

Interval.php:177

Tell if $value starts where this interval ends, with one of the two bounds closed, so they join with no gap

function touches(MMO\math\helpers\Interval $value): bool
$valueInterval
retournebool
(new Interval(1, 2, true, false))->touches(new Interval(2, 3)); //true: [1,2[u[2,3] is [1,3]

__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