BitArray.php
1 week ago
BitMatrix.php
1 week ago
BitUtils.php
1 week ago
CharacterSetEci.php
1 week ago
EcBlock.php
1 week ago
EcBlocks.php
1 week ago
ErrorCorrectionLevel.php
1 week ago
FormatInformation.php
1 week ago
Mode.php
1 week ago
ReedSolomonCodec.php
1 week ago
Version.php
1 week ago
index.php
1 week ago
EcBlock.php
46 lines
| 1 | <?php |
| 2 | |
| 3 | declare (strict_types=1); |
| 4 | namespace WP2FA_Vendor\BaconQrCode\Common; |
| 5 | |
| 6 | /** |
| 7 | * Encapsulates the parameters for one error-correction block in one symbol version. |
| 8 | * |
| 9 | * This includes the number of data codewords, and the number of times a block with these parameters is used |
| 10 | * consecutively in the QR code version's format. |
| 11 | */ |
| 12 | final class EcBlock |
| 13 | { |
| 14 | /** |
| 15 | * How many times the block is used. |
| 16 | * |
| 17 | * @var int |
| 18 | */ |
| 19 | private $count; |
| 20 | /** |
| 21 | * Number of data codewords. |
| 22 | * |
| 23 | * @var int |
| 24 | */ |
| 25 | private $dataCodewords; |
| 26 | public function __construct(int $count, int $dataCodewords) |
| 27 | { |
| 28 | $this->count = $count; |
| 29 | $this->dataCodewords = $dataCodewords; |
| 30 | } |
| 31 | /** |
| 32 | * Returns how many times the block is used. |
| 33 | */ |
| 34 | public function getCount() : int |
| 35 | { |
| 36 | return $this->count; |
| 37 | } |
| 38 | /** |
| 39 | * Returns the number of data codewords. |
| 40 | */ |
| 41 | public function getDataCodewords() : int |
| 42 | { |
| 43 | return $this->dataCodewords; |
| 44 | } |
| 45 | } |
| 46 |