\BaconQrCode\CommonMode

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

Summary

Methods
Properties
Constants
__construct()
change()
get()
getConstList()
__toString()
getCharacterCountBits()
No public properties found
__default
TERMINATOR
NUMERIC
ALPHANUMERIC
STRUCTURED_APPEND
BYTE
ECI
KANJI
FNC1_FIRST_POSITION
FNC1_SECOND_POSITION
HANZI
No protected methods found
$value
$constants
$strict
$characterCountBitsForVersions
N/A
No private methods found
No private properties found
N/A

Constants

__default

__default = null

Default value.

TERMINATOR

TERMINATOR = 0x0

NUMERIC

NUMERIC = 0x1

ALPHANUMERIC

ALPHANUMERIC = 0x2

STRUCTURED_APPEND

STRUCTURED_APPEND = 0x3

BYTE

BYTE = 0x4

ECI

ECI = 0x7

KANJI

KANJI = 0x8

FNC1_FIRST_POSITION

FNC1_FIRST_POSITION = 0x5

FNC1_SECOND_POSITION

FNC1_SECOND_POSITION = 0x9

HANZI

HANZI = 0xd

Properties

$value

$value : mixed

Current value.

Type

mixed

$constants

$constants : array

Cache of constants.

Type

array

$strict

$strict : bool

Whether to handle values strict or not.

Type

bool

$characterCountBitsForVersions

$characterCountBitsForVersions : array

Character count bits for each version.

Type

array

Methods

__construct()

__construct(mixed  $initialValue = null, bool  $strict = false) : mixed

Creates a new enum.

Parameters

mixed $initialValue
bool $strict

Returns

mixed —

change()

change(mixed  $value) : void

Changes the value of the enum.

Parameters

mixed $value

get()

get() : mixed

Gets current value.

Returns

mixed —

getConstList()

getConstList(bool  $includeDefault = true) : array

Gets all constants (possible values) as an array.

Parameters

bool $includeDefault

Returns

array —

__toString()

__toString() : string

Gets the name of the enum.

Returns

string —

getCharacterCountBits()

getCharacterCountBits(\BaconQrCode\Common\Version  $version) : int

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

Parameters

\BaconQrCode\Common\Version $version

Returns

int —