Documentation

CharacterSetEci extends AbstractEnum
in package

Encapsulates a Character Set ECI, according to "Extended Channel Interpretations" 5.3.1.1 of ISO 18004.

Table of Contents

ASCII  = [[27, 170], 'US-ASCII']
BIG5  = [[28]]
CP1250  = [[21], 'windows-1250']
CP1251  = [[22], 'windows-1251']
CP1252  = [[23], 'windows-1252']
CP1256  = [[24], 'windows-1256']
CP437  = [[0, 2]]
EUC_KR  = [[30], 'EUC-KR']
GB18030  = [[29], 'GB2312', 'EUC_CN', 'GBK']
ISO8859_1  = [[1, 3], 'ISO-8859-1']
ISO8859_10  = [[12], 'ISO-8859-10']
ISO8859_11  = [[13], 'ISO-8859-11']
ISO8859_12  = [[14], 'ISO-8859-12']
ISO8859_13  = [[15], 'ISO-8859-13']
ISO8859_14  = [[16], 'ISO-8859-14']
ISO8859_15  = [[17], 'ISO-8859-15']
ISO8859_16  = [[18], 'ISO-8859-16']
ISO8859_2  = [[4], 'ISO-8859-2']
ISO8859_3  = [[5], 'ISO-8859-3']
ISO8859_4  = [[6], 'ISO-8859-4']
ISO8859_5  = [[7], 'ISO-8859-5']
ISO8859_6  = [[8], 'ISO-8859-6']
ISO8859_7  = [[9], 'ISO-8859-7']
ISO8859_8  = [[10], 'ISO-8859-8']
ISO8859_9  = [[11], 'ISO-8859-9']
SJIS  = [[20], 'Shift_JIS']
UNICODE_BIG_UNMARKED  = [[25], 'UTF-16BE', 'UnicodeBig']
UTF8  = [[26], 'UTF-8']
$allValuesLoaded  : array<string, bool>
$constants  : array<string, array<string|int, mixed>>
$name  : string
$nameToEci  : array<string, self>|null
$ordinal  : int
$otherEncodingNames  : array<string|int, string>
$values  : array<string|int, int>
$valueToEci  : array<int, self>|null
__callStatic()  : static
Magic getter which forwards all calls to {@see self::valueOf()}.
__clone()  : mixed
Forbid cloning enums.
__construct()  : mixed
The constructor is private by default to avoid arbitrary enum creation.
__sleep()  : array<string|int, mixed>
Forbid serializing enums.
__toString()  : string
Turns the enum into a string representation.
__wakeup()  : void
Forbid unserializing enums.
ASCII()  : self
BIG5()  : self
compareTo()  : int
Compares this enum with the specified object for order.
CP1250()  : self
CP1251()  : self
CP1252()  : self
CP1256()  : self
CP437()  : self
EUC_KR()  : self
GB18030()  : self
getCharacterSetEciByName()  : self|null
Returns character set ECI by name.
getCharacterSetEciByValue()  : self|null
Gets character set ECI by value.
getValue()  : int
Returns the primary value.
ISO8859_1()  : self
ISO8859_10()  : self
ISO8859_11()  : self
ISO8859_12()  : self
ISO8859_13()  : self
ISO8859_14()  : self
ISO8859_15()  : self
ISO8859_16()  : self
ISO8859_2()  : self
ISO8859_3()  : self
ISO8859_4()  : self
ISO8859_5()  : self
ISO8859_6()  : self
ISO8859_7()  : self
ISO8859_8()  : self
ISO8859_9()  : self
name()  : string
Returns the name of this enum constant, exactly as declared in its enum declaration.
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).
SJIS()  : self
UNICODE_BIG_UNMARKED()  : self
UTF8()  : self
valueOf()  : static
Returns an enum with the specified name.
values()  : array<string|int, static>
Obtains all possible types defined by this enum.
constants()  : array<string|int, mixed>
createValue()  : static
nameToEci()  : array<string|int, mixed>
valueToEci()  : array<string|int, mixed>

Constants

UNICODE_BIG_UNMARKED

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

Properties

$allValuesLoaded

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

$constants

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

$otherEncodingNames

private array<string|int, string> $otherEncodingNames

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

__construct()

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

public __construct(array<string|int, mixed> $values, string ...$otherEncodingNames) : 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
$values : array<string|int, mixed>
$otherEncodingNames : string
Return values
mixed

__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

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

getCharacterSetEciByName()

Returns character set ECI by name.

public static getCharacterSetEciByName(string $name) : self|null

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

Parameters
$name : string
Return values
self|null

getCharacterSetEciByValue()

Gets character set ECI by value.

public static getCharacterSetEciByValue(int $value) : self|null

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

Parameters
$value : int
Tags
throws
InvalidArgumentException

if value is not between 0 and 900

Return values
self|null

getValue()

Returns the primary value.

public getValue() : int
Return values
int

ISO8859_10()

public static ISO8859_10() : self
Return values
self

ISO8859_11()

public static ISO8859_11() : self
Return values
self

ISO8859_12()

public static ISO8859_12() : self
Return values
self

ISO8859_13()

public static ISO8859_13() : self
Return values
self

ISO8859_14()

public static ISO8859_14() : self
Return values
self

ISO8859_15()

public static ISO8859_15() : self
Return values
self

ISO8859_16()

public static ISO8859_16() : 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

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

UNICODE_BIG_UNMARKED()

public static UNICODE_BIG_UNMARKED() : 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>

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

nameToEci()

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

valueToEci()

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

Search results