FileAccess Orion

Integer
in package
implements NumberInterface

A value object representing an integer

This class exists for type-safety purposes, to ensure that integers returned from ramsey/uuid methods as strings are truly integers and not some other kind of string.

To support large integers beyond PHP_INT_MAX and PHP_INT_MIN on both 64-bit and 32-bit systems, we store the integers as strings.

Tags
psalm-immutable

Interfaces, Classes, Traits and Enums

NumberInterface
NumberInterface ensures consistency in numeric values returned by ramsey/uuid

Table of Contents

$isNegative  : bool
$value  : string
__construct()  : mixed
__toString()  : string
isNegative()  : bool
Returns true if this number is less than zero
jsonSerialize()  : string
serialize()  : string
toString()  : string
unserialize()  : void
Constructs the object from a serialized string representation

Properties

$isNegative

private bool $isNegative = false

Methods

__construct()

public __construct(mixed $value) : mixed
Parameters
$value : mixed

The integer value to store

Return values
mixed

__toString()

public __toString() : string
Return values
string

isNegative()

Returns true if this number is less than zero

public isNegative() : bool
Return values
bool

jsonSerialize()

public jsonSerialize() : string
Return values
string

serialize()

public serialize() : string
Return values
string

toString()

public toString() : string
Return values
string

unserialize()

Constructs the object from a serialized string representation

public unserialize(string $serialized) : void
Parameters
$serialized : string

The serialized string representation of the object

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint

Return values
void

Search results