characterCountBitsForVersions = $characterCountBitsForVersions; $this->bits = $bits; } /** * Returns the number of bits used in a specific QR code version. */ public function getCharacterCountBits(Version $version) : int { $number = $version->getVersionNumber(); if ($number <= 9) { $offset = 0; } elseif ($number <= 26) { $offset = 1; } else { $offset = 2; } return $this->characterCountBitsForVersions[$offset]; } /** * Returns the four bits used to encode this mode. */ public function getBits() : int { return $this->bits; } }