* @copyright 2015-2026 Nicola Asuni - Tecnick.com LTD * @license https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE) * @link https://github.com/tecnickcom/tc-lib-barcode * * This file is part of tc-lib-barcode software library. */ namespace Test\Fixture; /** * @phpstan-import-type Item from \Com\Tecnick\Barcode\Type\Square\QrCode\Estimate */ class InternalQrByteStream extends \Com\Tecnick\Barcode\Type\Square\QrCode\ByteStream { /** * @var array, 1: int}> */ public array $queuedCbs = []; public ?int $forcedEstVer = null; public ?int $forcedMinVer = null; public function exposeLookAnTable(int $chr): int { return $this->lookAnTable($chr); } /** * @param array $items * @param array $data * * @return array * @throws \Com\Tecnick\Barcode\Exception */ public function exposeAppendNewInputItem(array $items, int $mode, int $size, array $data): array { return $this->appendNewInputItem($items, $mode, $size, $data); } /** * @param array $data * @param array $bstream * * @return Item * @throws \Com\Tecnick\Barcode\Exception */ public function exposeNewInputItem(int $mode, int $size, array $data, array $bstream = []): array { return $this->newInputItem($mode, $size, $data, $bstream); } /** * @param array $bstream * * @return array */ public function exposeAppendPaddingBit(array $bstream): array { return $this->appendPaddingBit($bstream); } /** * @param array $bstream * * @return array */ public function exposeBitstreamToByte(array $bstream): array { return $this->bitstreamToByte($bstream); } /** * @param array $items * * @return array * @throws \Com\Tecnick\Barcode\Exception */ public function exposeConvertData(array $items): array { return $this->convertData($items); } /** * @param array $items * * @return array{0: array, 1: int} * @throws \Com\Tecnick\Barcode\Exception */ public function exposeCreateBitStream(array $items): array { return parent::createBitStream($items); } /** * @param array $items */ public function estimateVersion(array $items, int $level): int { return $this->forcedEstVer ?? parent::estimateVersion($items, $level); } /** * @param array $items * * @return array{0: array, 1: int} */ protected function createBitStream(array $items): array { if ($this->queuedCbs !== []) { return \array_shift($this->queuedCbs); } return parent::createBitStream($items); } protected function getMinimumVersion(int $size, int $level): int { return $this->forcedMinVer ?? parent::getMinimumVersion($size, $level); } }