Properties

$versionDecodeInfo

$versionDecodeInfo : array

Version decode information.

Type

array

$versions

$versions : array

Cached version instances.

Type

array

$versionNumber

$versionNumber : int

Version number of this version.

Type

int

$alignmentPatternCenters

$alignmentPatternCenters : \SplFixedArray

Alignment pattern centers.

Type

\SplFixedArray —

$errorCorrectionBlocks

$errorCorrectionBlocks : \SplFixedArray

Error correction blocks.

Type

\SplFixedArray —

$totalCodewords

$totalCodewords : int

Total number of codewords.

Type

int

Methods

getVersionNumber()

getVersionNumber() : int

Gets the version number.

Returns

int —

getAlignmentPatternCenters()

getAlignmentPatternCenters() : \SplFixedArray

Gets the alignment pattern centers.

Returns

\SplFixedArray —

getTotalCodewords()

getTotalCodewords() : int

Gets the total number of codewords.

Returns

int —

getDimensionForVersion()

getDimensionForVersion() : int

Gets the dimension for the current version.

Returns

int —

getEcBlocksForLevel()

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

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

Parameters

\BaconQrCode\Common\ErrorCorrectionLevel $ecLevel

Returns

int —

getProvisionalVersionForDimension()

getProvisionalVersionForDimension(int  $dimension) : \BaconQrCode\Common\Version

Gets a provisional version number for a specific dimension.

Parameters

int $dimension

Throws

\BaconQrCode\Common\Exception\InvalidArgumentException

Returns

\BaconQrCode\Common\Version —

getVersionForNumber()

getVersionForNumber(int  $versionNumber) : \BaconQrCode\Common\Version

Gets a version instance for a specific version number.

Parameters

int $versionNumber

Throws

\BaconQrCode\Common\Exception\InvalidArgumentException

Returns

\BaconQrCode\Common\Version —

decodeVersionInformation()

decodeVersionInformation(int  $versionBits) : \BaconQrCode\Common\Version|null

Decodes version information from an integer and returns the version.

Parameters

int $versionBits

Returns

\BaconQrCode\Common\Version|null —

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, \SplFixedArray  $alignmentPatternCenters, \SplFixedArray  $ecBlocks) : mixed

Creates a new version.

Parameters

int $versionNumber
\SplFixedArray $alignmentPatternCenters
\SplFixedArray $ecBlocks

Returns

mixed —

buildVersion()

buildVersion(int  $versionNumber) : void

Build and cache a specific version.

See ISO 18004:2006 6.5.1 Table 9.

Parameters

int $versionNumber