\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 = 0

NUMERIC

NUMERIC = 1

ALPHANUMERIC

ALPHANUMERIC = 2

STRUCTURED_APPEND

STRUCTURED_APPEND = 3

BYTE

BYTE = 4

ECI

ECI = 7

KANJI

KANJI = 8

FNC1_FIRST_POSITION

FNC1_FIRST_POSITION = 5

FNC1_SECOND_POSITION

FNC1_SECOND_POSITION = 9

HANZI

HANZI = 13

Properties

$value

$value : mixed

Current value.

Type

mixed

$constants

$constants : array

Cache of constants.

Type

array

$strict

$strict : boolean

Whether to handle values strict or not.

Type

boolean

$characterCountBitsForVersions

$characterCountBitsForVersions : array

Character count bits for each version.

Type

array

Methods

__construct()

__construct(mixed  $initialValue = null, boolean  $strict = false) 

Creates a new enum.

Parameters

mixed $initialValue
boolean $strict

change()

change(mixed  $value) : void

Changes the value of the enum.

Parameters

mixed $value

get()

get() : mixed

Gets current value.

Returns

mixed

getConstList()

getConstList(boolean  $includeDefault = true) : array

Gets all constants (possible values) as an array.

Parameters

boolean $includeDefault

Returns

array

__toString()

__toString() : string

Gets the name of the enum.

Returns

string

getCharacterCountBits()

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

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

Parameters

\BaconQrCode\Common\Version $version

Returns

integer