diff --git a/src/Data/MaskPatternTester.php b/src/Data/MaskPatternTester.php index d7cedbe23..8e470f57b 100644 --- a/src/Data/MaskPatternTester.php +++ b/src/Data/MaskPatternTester.php @@ -62,7 +62,7 @@ final class MaskPatternTester{ * @see \chillerlan\QRCode\Data\QRMatrix::$maskPattern */ public function testPattern(int $pattern):int{ - $matrix = $this->qrData->initMatrix($pattern, true); + $matrix = $this->qrData->writeMatrix($pattern, true); $penalty = 0; for($level = 1; $level <= 4; $level++){ diff --git a/src/Data/QRData.php b/src/Data/QRData.php index 79fa99123..28ed1ad76 100644 --- a/src/Data/QRData.php +++ b/src/Data/QRData.php @@ -100,7 +100,7 @@ class QRData{ /** * returns a fresh matrix object with the data written for the given $maskPattern */ - public function initMatrix(int $maskPattern, bool $test = null):QRMatrix{ + public function writeMatrix(int $maskPattern, bool $test = null):QRMatrix{ $data = (new ReedSolomonEncoder)->interleaveEcBytes($this->bitBuffer, $this->version, $this->eccLevel); return (new QRMatrix($this->version, $this->eccLevel)) diff --git a/src/QRCode.php b/src/QRCode.php index b8dffce50..d654d2a3b 100755 --- a/src/QRCode.php +++ b/src/QRCode.php @@ -158,7 +158,7 @@ class QRCode{ ? (new MaskPatternTester($this->dataInterface))->getBestMaskPattern() : $this->options->maskPattern; - $matrix = $this->dataInterface->initMatrix($maskPattern); + $matrix = $this->dataInterface->writeMatrix($maskPattern); if((bool)$this->options->addQuietzone){ $matrix->setQuietZone($this->options->quietzoneSize); diff --git a/tests/Data/DatainterfaceTestAbstract.php b/tests/Data/DatainterfaceTestAbstract.php index 0e0361dfc..e0faee38a 100644 --- a/tests/Data/DatainterfaceTestAbstract.php +++ b/tests/Data/DatainterfaceTestAbstract.php @@ -82,7 +82,7 @@ abstract class DatainterfaceTestAbstract extends TestCase{ public function testInitMatrix(int $maskPattern):void{ $this->dataInterface->setData([$this->testdata]); - $matrix = $this->dataInterface->initMatrix($maskPattern); + $matrix = $this->dataInterface->writeMatrix($maskPattern); $this::assertInstanceOf(QRMatrix::class, $matrix); $this::assertSame($maskPattern, $matrix->maskPattern()); diff --git a/tests/Output/QROutputTestAbstract.php b/tests/Output/QROutputTestAbstract.php index 633b99206..b6eec6b99 100644 --- a/tests/Output/QROutputTestAbstract.php +++ b/tests/Output/QROutputTestAbstract.php @@ -48,7 +48,7 @@ abstract class QROutputTestAbstract extends TestCase{ } $this->options = new QROptions; - $this->matrix = (new QRData($this->options, [[Byte::class, 'testdata']]))->initMatrix(0); + $this->matrix = (new QRData($this->options, [[Byte::class, 'testdata']]))->writeMatrix(0); $this->outputInterface = $this->getOutputInterface($this->options); }