:octocat: extract MaskPattern

This commit is contained in:
codemasher
2021-01-19 01:15:34 +01:00
parent 307b6462f6
commit 182ebf4e70
10 changed files with 120 additions and 66 deletions
+2 -2
View File
@@ -12,7 +12,7 @@
namespace chillerlan\QRCode\Data;
use chillerlan\QRCode\Common\{BitBuffer, EccLevel, Mode, ReedSolomonEncoder, Version};
use chillerlan\QRCode\Common\{BitBuffer, EccLevel, MaskPattern, Mode, ReedSolomonEncoder, Version};
use chillerlan\QRCode\QRCode;
use chillerlan\Settings\SettingsContainerInterface;
@@ -100,7 +100,7 @@ final class QRData{
/**
* returns a fresh matrix object with the data written for the given $maskPattern
*/
public function writeMatrix(int $maskPattern, bool $test = null):QRMatrix{
public function writeMatrix(MaskPattern $maskPattern, bool $test = null):QRMatrix{
$data = (new ReedSolomonEncoder)->interleaveEcBytes($this->bitBuffer, $this->version, $this->eccLevel);
return (new QRMatrix($this->version, $this->eccLevel))