Constants

CP437

CP437 = [[0, 2]]

ISO8859_1

ISO8859_1 = [[1, 3], 'ISO-8859-1']

ISO8859_2

ISO8859_2 = [[4], 'ISO-8859-2']

ISO8859_3

ISO8859_3 = [[5], 'ISO-8859-3']

ISO8859_4

ISO8859_4 = [[6], 'ISO-8859-4']

ISO8859_5

ISO8859_5 = [[7], 'ISO-8859-5']

ISO8859_6

ISO8859_6 = [[8], 'ISO-8859-6']

ISO8859_7

ISO8859_7 = [[9], 'ISO-8859-7']

ISO8859_8

ISO8859_8 = [[10], 'ISO-8859-8']

ISO8859_9

ISO8859_9 = [[11], 'ISO-8859-9']

ISO8859_10

ISO8859_10 = [[12], 'ISO-8859-10']

ISO8859_11

ISO8859_11 = [[13], 'ISO-8859-11']

ISO8859_12

ISO8859_12 = [[14], 'ISO-8859-12']

ISO8859_13

ISO8859_13 = [[15], 'ISO-8859-13']

ISO8859_14

ISO8859_14 = [[16], 'ISO-8859-14']

ISO8859_15

ISO8859_15 = [[17], 'ISO-8859-15']

ISO8859_16

ISO8859_16 = [[18], 'ISO-8859-16']

SJIS

SJIS = [[20], 'Shift_JIS']

CP1250

CP1250 = [[21], 'windows-1250']

CP1251

CP1251 = [[22], 'windows-1251']

CP1252

CP1252 = [[23], 'windows-1252']

CP1256

CP1256 = [[24], 'windows-1256']

UNICODE_BIG_UNMARKED

UNICODE_BIG_UNMARKED = [[25], 'UTF-16BE', 'UnicodeBig']

UTF8

UTF8 = [[26], 'UTF-8']

ASCII

ASCII = [[27, 170], 'US-ASCII']

BIG5

BIG5 = [[28]]

GB18030

GB18030 = [[29], 'GB2312', 'EUC_CN', 'GBK']

EUC_KR

EUC_KR = [[30], 'EUC-KR']

Properties

$name

$name : string

Type

string

$ordinal

$ordinal : int

Type

int

$values

$values : int[]

Type

int[]

$allValuesLoaded

$allValuesLoaded : array<string,bool>

Type

array

$constants

$constants : array<string,array>

Type

array

$otherEncodingNames

$otherEncodingNames : string[]

Type

string[]

$valueToEci

$valueToEci : array<int,self>|null

Type

array|null

$nameToEci

$nameToEci : array<string,self>|null

Type

array|null

Methods

__construct()

__construct(array  $values, string  ...$otherEncodingNames) : mixed

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

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

array $values
string $otherEncodingNames variadic

Returns

mixed —

__callStatic()

__callStatic(string  $name, array  $arguments) : static

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

Parameters

string $name
array $arguments

Returns

static —

valueOf()

valueOf(string  $name) : static

Returns an enum with the specified name.

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

Parameters

string $name

Throws

\DASPRiD\Enum\Exception\IllegalArgumentException

if the enum has no constant with the specified name

Returns

static —

values()

values() : static[]

Obtains all possible types defined by this enum.

Returns

static[] —

name()

name() : string

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

Most programmers should use the {@see \DASPRiD\Enum\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.

Returns

string —

ordinal()

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).

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

Returns

int —

compareTo()

compareTo(self  $other) : int

Compares this enum with the specified object for order.

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

self $other

Throws

\DASPRiD\Enum\Exception\MismatchException

if the passed enum is not of the same type

Returns

int —

__clone()

__clone() : mixed

Forbid cloning enums.

Throws

\DASPRiD\Enum\Exception\CloneNotSupportedException

Returns

mixed —

__sleep()

__sleep() : array

Forbid serializing enums.

Throws

\DASPRiD\Enum\Exception\SerializeNotSupportedException

Returns

array —

__wakeup()

__wakeup() : void

Forbid unserializing enums.

Throws

\DASPRiD\Enum\Exception\UnserializeNotSupportedException

__toString()

__toString() : string

Turns the enum into a string representation.

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

Returns

string —

getValue()

getValue() : int

Returns the primary value.

Returns

int —

getCharacterSetEciByValue()

getCharacterSetEciByValue(int  $value) : ?self

Gets character set ECI by value.

Returns the representing ECI of a given value, or null if it is legal but unsupported.

Parameters

int $value

Throws

\BaconQrCode\Exception\InvalidArgumentException

if value is not between 0 and 900

Returns

?self —

getCharacterSetEciByName()

getCharacterSetEciByName(string  $name) : ?self

Returns character set ECI by name.

Returns the representing ECI of a given name, or null if it is legal but unsupported

Parameters

string $name

Returns

?self —

CP437()

CP437() : self

Returns

self —

ISO8859_1()

ISO8859_1() : self

Returns

self —

ISO8859_2()

ISO8859_2() : self

Returns

self —

ISO8859_3()

ISO8859_3() : self

Returns

self —

ISO8859_4()

ISO8859_4() : self

Returns

self —

ISO8859_5()

ISO8859_5() : self

Returns

self —

ISO8859_6()

ISO8859_6() : self

Returns

self —

ISO8859_7()

ISO8859_7() : self

Returns

self —

ISO8859_8()

ISO8859_8() : self

Returns

self —

ISO8859_9()

ISO8859_9() : self

Returns

self —

ISO8859_10()

ISO8859_10() : self

Returns

self —

ISO8859_11()

ISO8859_11() : self

Returns

self —

ISO8859_12()

ISO8859_12() : self

Returns

self —

ISO8859_13()

ISO8859_13() : self

Returns

self —

ISO8859_14()

ISO8859_14() : self

Returns

self —

ISO8859_15()

ISO8859_15() : self

Returns

self —

ISO8859_16()

ISO8859_16() : self

Returns

self —

SJIS()

SJIS() : self

Returns

self —

CP1250()

CP1250() : self

Returns

self —

CP1251()

CP1251() : self

Returns

self —

CP1252()

CP1252() : self

Returns

self —

CP1256()

CP1256() : self

Returns

self —

UNICODE_BIG_UNMARKED()

UNICODE_BIG_UNMARKED() : self

Returns

self —

UTF8()

UTF8() : self

Returns

self —

ASCII()

ASCII() : self

Returns

self —

BIG5()

BIG5() : self

Returns

self —

GB18030()

GB18030() : self

Returns

self —

EUC_KR()

EUC_KR() : self

Returns

self —

createValue()

createValue(string  $name, int  $ordinal, array  $arguments) : static

Parameters

string $name
int $ordinal
array $arguments

Returns

static —

constants()

constants() : array

Returns

array —

valueToEci()

valueToEci() : array

Returns

array —

nameToEci()

nameToEci() : array

Returns

array —