BlockPair.php
11 months ago
ByteMatrix.php
11 months ago
Encoder.php
11 months ago
MaskUtil.php
11 months ago
MatrixUtil.php
11 months ago
QrCode.php
11 months ago
BlockPair.php
54 lines
| 1 | <?php |
| 2 | |
| 3 | declare (strict_types=1); |
| 4 | namespace WP2FA_Vendor\BaconQrCode\Encoder; |
| 5 | |
| 6 | use SplFixedArray; |
| 7 | /** |
| 8 | * Block pair. |
| 9 | */ |
| 10 | final class BlockPair |
| 11 | { |
| 12 | /** |
| 13 | * Data bytes in the block. |
| 14 | * |
| 15 | * @var SplFixedArray<int> |
| 16 | */ |
| 17 | private $dataBytes; |
| 18 | /** |
| 19 | * Error correction bytes in the block. |
| 20 | * |
| 21 | * @var SplFixedArray<int> |
| 22 | */ |
| 23 | private $errorCorrectionBytes; |
| 24 | /** |
| 25 | * Creates a new block pair. |
| 26 | * |
| 27 | * @param SplFixedArray<int> $data |
| 28 | * @param SplFixedArray<int> $errorCorrection |
| 29 | */ |
| 30 | public function __construct(SplFixedArray $data, SplFixedArray $errorCorrection) |
| 31 | { |
| 32 | $this->dataBytes = $data; |
| 33 | $this->errorCorrectionBytes = $errorCorrection; |
| 34 | } |
| 35 | /** |
| 36 | * Gets the data bytes. |
| 37 | * |
| 38 | * @return SplFixedArray<int> |
| 39 | */ |
| 40 | public function getDataBytes() : SplFixedArray |
| 41 | { |
| 42 | return $this->dataBytes; |
| 43 | } |
| 44 | /** |
| 45 | * Gets the error correction bytes. |
| 46 | * |
| 47 | * @return SplFixedArray<int> |
| 48 | */ |
| 49 | public function getErrorCorrectionBytes() : SplFixedArray |
| 50 | { |
| 51 | return $this->errorCorrectionBytes; |
| 52 | } |
| 53 | } |
| 54 |