Version
in package
Version representation.
Table of Contents
- 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]
- $alignmentPatternCenters : SplFixedArray
- Alignment pattern centers.
- $ecBlocks : array<string|int, EcBlocks>
- Error correction blocks.
- $totalCodewords : int
- Total number of codewords.
- $versionNumber : int
- Version number of this version.
- $versions : array<int, self>|null
- Cached version instances.
- __toString() : string
- Returns a string representation for the version.
- buildFunctionPattern() : BitMatrix
- Builds the function pattern for the current version.
- decodeVersionInformation() : self|null
- Decodes version information from an integer and returns the version.
- getAlignmentPatternCenters() : array<string|int, int>
- Returns the alignment pattern centers.
- getDimensionForVersion() : int
- Calculates the dimension for the current version.
- getEcBlocksForLevel() : EcBlocks
- Returns the number of EC blocks for a specific EC level.
- getProvisionalVersionForDimension() : self
- Gets a provisional version number for a specific dimension.
- getTotalCodewords() : int
- Returns the total number of codewords.
- getVersionForNumber() : self
- Gets a version instance for a specific version number.
- getVersionNumber() : int
- Returns the version number.
- __construct() : mixed
- versions() : array<int, self>
- Build and cache a specific version.
Constants
VERSION_DECODE_INFO
private
mixed
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
$alignmentPatternCenters
Alignment pattern centers.
private
SplFixedArray
$alignmentPatternCenters
$ecBlocks
Error correction blocks.
private
array<string|int, EcBlocks>
$ecBlocks
$totalCodewords
Total number of codewords.
private
int
$totalCodewords
$versionNumber
Version number of this version.
private
int
$versionNumber
$versions
Cached version instances.
private
static array<int, self>|null
$versions
Methods
__toString()
Returns a string representation for the version.
public
__toString() : string
Return values
string —buildFunctionPattern()
Builds the function pattern for the current version.
public
buildFunctionPattern() : BitMatrix
Return values
BitMatrix —decodeVersionInformation()
Decodes version information from an integer and returns the version.
public
static decodeVersionInformation(int $versionBits) : self|null
Parameters
- $versionBits : int
Return values
self|null —getAlignmentPatternCenters()
Returns the alignment pattern centers.
public
getAlignmentPatternCenters() : array<string|int, int>
Return values
array<string|int, int> —getDimensionForVersion()
Calculates the dimension for the current version.
public
getDimensionForVersion() : int
Return values
int —getEcBlocksForLevel()
Returns the number of EC blocks for a specific EC level.
public
getEcBlocksForLevel(ErrorCorrectionLevel $ecLevel) : EcBlocks
Parameters
- $ecLevel : ErrorCorrectionLevel
Return values
EcBlocks —getProvisionalVersionForDimension()
Gets a provisional version number for a specific dimension.
public
static getProvisionalVersionForDimension(int $dimension) : self
Parameters
- $dimension : int
Tags
Return values
self —getTotalCodewords()
Returns the total number of codewords.
public
getTotalCodewords() : int
Return values
int —getVersionForNumber()
Gets a version instance for a specific version number.
public
static getVersionForNumber(int $versionNumber) : self
Parameters
- $versionNumber : int
Tags
Return values
self —getVersionNumber()
Returns the version number.
public
getVersionNumber() : int
Return values
int —__construct()
private
__construct(int $versionNumber, array<string|int, int> $alignmentPatternCenters, EcBlocks ...$ecBlocks) : mixed
Parameters
- $versionNumber : int
- $alignmentPatternCenters : array<string|int, int>
- $ecBlocks : EcBlocks
Return values
mixed —versions()
Build and cache a specific version.
private
static versions() : array<int, self>
See ISO 18004:2006 6.5.1 Table 9.