ErrorCorrectionLevel
extends AbstractEnum
in package
Enum representing the four error correction levels.
Table of Contents
- H = [0x2]
- L = [0x1]
- M = [0x0]
- Q = [0x3]
- $allValuesLoaded : array<string, bool>
- $bits : 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.
- compareTo() : int
- Compares this enum with the specified object for order.
- forBits() : self
- getBits() : int
- Returns the two bits used to encode this error correction level.
- H() : self
- L() : self
- M() : 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).
- Q() : 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
H
protected
mixed
H
= [0x2]
L
protected
mixed
L
= [0x1]
M
protected
mixed
M
= [0x0]
Q
protected
mixed
Q
= [0x3]
Properties
$allValuesLoaded
private
static array<string, bool>
$allValuesLoaded
= []
$bits
private
int
$bits
$constants
private
static array<string, array<string|int, mixed>>
$constants
= []
$name
private
string
$name
$ordinal
private
int
$ordinal
$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 —__clone()
Forbid cloning enums.
public
final __clone() : mixed
Tags
Return values
mixed —__sleep()
Forbid serializing enums.
public
final __sleep() : array<string|int, mixed>
Tags
Return values
array<string|int, 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 —__wakeup()
Forbid unserializing enums.
public
final __wakeup() : void
Tags
Return values
void —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
Return values
int —forBits()
public
static forBits(int $bits) : self
Parameters
- $bits : int
Tags
Return values
self —getBits()
Returns the two bits used to encode this error correction level.
public
getBits() : int
Return values
int —H()
public
static H() : self
~30% correction
Return values
self —L()
public
static L() : self
~7% correction
Return values
self —M()
public
static M() : self
~15% correction
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 —Q()
public
static Q() : self
~25% correction
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
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(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
- $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>