Documentation

Mode extends AbstractEnum
in package

Enum representing various modes in which data can be encoded to bits.

Table of Contents

ALPHANUMERIC  = [[9, 11, 13], 0x2]
BYTE  = [[8, 16, 16], 0x4]
ECI  = [[0, 0, 0], 0x7]
FNC1_FIRST_POSITION  = [[0, 0, 0], 0x5]
FNC1_SECOND_POSITION  = [[0, 0, 0], 0x9]
HANZI  = [[8, 10, 12], 0xd]
KANJI  = [[8, 10, 12], 0x8]
NUMERIC  = [[10, 12, 14], 0x1]
STRUCTURED_APPEND  = [[0, 0, 0], 0x3]
TERMINATOR  = [[0, 0, 0], 0x0]
$allValuesLoaded  : array<string, bool>
$bits  : int
$characterCountBitsForVersions  : array<string|int, int>
$constants  : array<string, array<string|int, mixed>>
$name  : string
$ordinal  : int
$values  : array<string, array<string, static>>
__callStatic()  : static
Magic getter which forwards all calls to {@see self::valueOf()}.
__clone()  : mixed
Forbid cloning enums.
__sleep()  : array<string|int, mixed>
Forbid serializing enums.
__toString()  : string
Turns the enum into a string representation.
__wakeup()  : void
Forbid unserializing enums.
ALPHANUMERIC()  : self
BYTE()  : self
compareTo()  : int
Compares this enum with the specified object for order.
ECI()  : self
FNC1_FIRST_POSITION()  : self
FNC1_SECOND_POSITION()  : self
getBits()  : int
Returns the four bits used to encode this mode.
getCharacterCountBits()  : int
Returns the number of bits used in a specific QR code version.
HANZI()  : self
KANJI()  : self
name()  : string
Returns the name of this enum constant, exactly as declared in its enum declaration.
NUMERIC()  : self
ordinal()  : int
Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).
STRUCTURED_APPEND()  : self
TERMINATOR()  : self
valueOf()  : static
Returns an enum with the specified name.
values()  : array<string|int, static>
Obtains all possible types defined by this enum.
__construct()  : mixed
The constructor is private by default to avoid arbitrary enum creation.
constants()  : array<string|int, mixed>
createValue()  : static

Constants

ALPHANUMERIC

protected mixed ALPHANUMERIC = [[9, 11, 13], 0x2]

BYTE

protected mixed BYTE = [[8, 16, 16], 0x4]

ECI

protected mixed ECI = [[0, 0, 0], 0x7]

FNC1_FIRST_POSITION

protected mixed FNC1_FIRST_POSITION = [[0, 0, 0], 0x5]

FNC1_SECOND_POSITION

protected mixed FNC1_SECOND_POSITION = [[0, 0, 0], 0x9]

HANZI

protected mixed HANZI = [[8, 10, 12], 0xd]

KANJI

protected mixed KANJI = [[8, 10, 12], 0x8]

NUMERIC

protected mixed NUMERIC = [[10, 12, 14], 0x1]

STRUCTURED_APPEND

protected mixed STRUCTURED_APPEND = [[0, 0, 0], 0x3]

TERMINATOR

protected mixed TERMINATOR = [[0, 0, 0], 0x0]

Properties

$allValuesLoaded

private static array<string, bool> $allValuesLoaded = []

$characterCountBitsForVersions

private array<string|int, int> $characterCountBitsForVersions

$constants

private static array<string, array<string|int, mixed>> $constants = []

$values

private static array<string, array<string, static>> $values = []

Methods

__callStatic()

Magic getter which forwards all calls to {@see self::valueOf()}.

public final static __callStatic(string $name, array<string|int, mixed> $arguments) : static
Parameters
$name : string
$arguments : array<string|int, mixed>
Return values
static

__toString()

Turns the enum into a string representation.

public __toString() : string

You may override this method to give a more user-friendly version.

Return values
string

ALPHANUMERIC()

public static ALPHANUMERIC() : self
Return values
self

BYTE()

public static BYTE() : self
Return values
self

compareTo()

Compares this enum with the specified object for order.

public final compareTo(self $other) : int

Returns negative integer, zero or positive integer as this object is less than, equal to or greater than the specified object.

Enums are only comparable to other enums of the same type. The natural order implemented by this method is the order in which the constants are declared.

Parameters
$other : self
Tags
throws
MismatchException

if the passed enum is not of the same type

Return values
int

ECI()

public static ECI() : self
Return values
self

FNC1_FIRST_POSITION()

public static FNC1_FIRST_POSITION() : self
Return values
self

FNC1_SECOND_POSITION()

public static FNC1_SECOND_POSITION() : self
Return values
self

getBits()

Returns the four bits used to encode this mode.

public getBits() : int
Return values
int

getCharacterCountBits()

Returns the number of bits used in a specific QR code version.

public getCharacterCountBits(Version $version) : int
Parameters
$version : Version
Return values
int

HANZI()

public static HANZI() : self
Return values
self

KANJI()

public static KANJI() : self
Return values
self

name()

Returns the name of this enum constant, exactly as declared in its enum declaration.

public final name() : string

Most programmers should use the self::__toString() method in preference to this one, as the toString method may return a more user-friendly name. This method is designed primarily for use in specialized situations where correctness depends on getting the exact name, which will not vary from release to release.

Return values
string

NUMERIC()

public static NUMERIC() : self
Return values
self

ordinal()

Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).

public final ordinal() : int

Most programmers will have no use for this method. It is designed for use by sophisticated enum-based data structures.

Return values
int

STRUCTURED_APPEND()

public static STRUCTURED_APPEND() : self
Return values
self

TERMINATOR()

public static TERMINATOR() : self
Return values
self

valueOf()

Returns an enum with the specified name.

public final static valueOf(string $name) : static

The name must match exactly an identifier used to declare an enum in this type (extraneous whitespace characters are not permitted).

Parameters
$name : string
Tags
throws
IllegalArgumentException

if the enum has no constant with the specified name

Return values
static

values()

Obtains all possible types defined by this enum.

public final static values() : array<string|int, static>
Return values
array<string|int, static>

__construct()

The constructor is private by default to avoid arbitrary enum creation.

protected __construct(array<string|int, mixed> $characterCountBitsForVersions, int $bits) : mixed

When creating your own constructor for a parameterized enum, make sure to declare it as protected, so that the static methods are able to construct it. Avoid making it public, as that would allow creation of non-singleton enum instances.

Parameters
$characterCountBitsForVersions : array<string|int, mixed>
$bits : int
Return values
mixed

constants()

private static constants() : array<string|int, mixed>
Return values
array<string|int, mixed>

createValue()

private static createValue(string $name, int $ordinal, array<string|int, mixed> $arguments) : static
Parameters
$name : string
$ordinal : int
$arguments : array<string|int, mixed>
Return values
static

Search results