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