mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-30 12:07:32 +00:00
:octocat: renamed QRData:initMatrix() to writeMatrix()
This commit is contained in:
@@ -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++){
|
||||
|
||||
+1
-1
@@ -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))
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user