| 1 |
<?php |
| 2 |
declare(strict_types = 1); |
| 3 |
|
| 4 |
namespace 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 |
public function __construct(private readonly int $count, private readonly int $dataCodewords) |
| 15 |
{ |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* Returns how many times the block is used. |
| 20 |
*/ |
| 21 |
public function getCount() : int |
| 22 |
{ |
| 23 |
return $this->count; |
| 24 |
} |
| 25 |
|
| 26 |
/** |
| 27 |
* Returns the number of data codewords. |
| 28 |
*/ |
| 29 |
public function getDataCodewords() : int |
| 30 |
{ |
| 31 |
return $this->dataCodewords; |
| 32 |
} |
| 33 |
} |