Constants

VERSION_DECODE_INFO

VERSION_DECODE_INFO = [0x7c94, 0x85bc, 0x9a99, 0xa4d3, 0xbbf6, 0xc762, 0xd847, 0xe60d, 0xf928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, 0x27541, 0x28c69]

Properties

$versionNumber

$versionNumber : int

Version number of this version.

Type

int

$alignmentPatternCenters

$alignmentPatternCenters : \SplFixedArray

Alignment pattern centers.

Type

\SplFixedArray —

$ecBlocks

$ecBlocks : \BaconQrCode\Common\EcBlocks[]

Error correction blocks.

Type

EcBlocks[]

$totalCodewords

$totalCodewords : int

Total number of codewords.

Type

int

$versions

$versions : array<int,self>|null

Cached version instances.

Type

array|null

Methods

getVersionNumber()

getVersionNumber() : int

Returns the version number.

Returns

int —

getAlignmentPatternCenters()

getAlignmentPatternCenters() : int[]

Returns the alignment pattern centers.

Returns

int[] —

getTotalCodewords()

getTotalCodewords() : int

Returns the total number of codewords.

Returns

int —

getDimensionForVersion()

getDimensionForVersion() : int

Calculates the dimension for the current version.

Returns

int —

getEcBlocksForLevel()

getEcBlocksForLevel(\BaconQrCode\Common\ErrorCorrectionLevel  $ecLevel) : \BaconQrCode\Common\EcBlocks

Returns the number of EC blocks for a specific EC level.

Parameters

\BaconQrCode\Common\ErrorCorrectionLevel $ecLevel

Returns

\BaconQrCode\Common\EcBlocks —

getProvisionalVersionForDimension()

getProvisionalVersionForDimension(int  $dimension) : self

Gets a provisional version number for a specific dimension.

Parameters

int $dimension

Throws

\BaconQrCode\Exception\InvalidArgumentException

if dimension is not 1 mod 4

Returns

self —

getVersionForNumber()

getVersionForNumber(int  $versionNumber) : self

Gets a version instance for a specific version number.

Parameters

int $versionNumber

Throws

\BaconQrCode\Exception\InvalidArgumentException

if version number is out of range

Returns

self —

decodeVersionInformation()

decodeVersionInformation(int  $versionBits) : ?self

Decodes version information from an integer and returns the version.

Parameters

int $versionBits

Returns

?self —

buildFunctionPattern()

buildFunctionPattern() : \BaconQrCode\Common\BitMatrix

Builds the function pattern for the current version.

Returns

\BaconQrCode\Common\BitMatrix —

__toString()

__toString() : string

Returns a string representation for the version.

Returns

string —

__construct()

__construct(int  $versionNumber, int[]  $alignmentPatternCenters, \BaconQrCode\Common\EcBlocks  ...$ecBlocks) : mixed

Parameters

int $versionNumber
int[] $alignmentPatternCenters
\BaconQrCode\Common\EcBlocks $ecBlocks variadic

Returns

mixed —

versions()

versions() : array<int,self>

Build and cache a specific version.

See ISO 18004:2006 6.5.1 Table 9.

Returns

array