Skip to content

Commit 1b2aa52

Browse files
committed
:octocat: proper names for QRMatrix getters
1 parent 284c42d commit 1b2aa52

20 files changed

+57
-57
lines changed

examples/imageWithLogo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function dump(string $file = null, string $logo = null):string{
5252
$lh = (($this->options->logoSpaceHeight - 2) * $this->options->scale);
5353

5454
// get the qrcode size
55-
$ql = ($this->matrix->size() * $this->options->scale);
55+
$ql = ($this->matrix->getSize() * $this->options->scale);
5656

5757
// scale the logo and copy it over. done!
5858
imagecopyresampled($this->image, $im, (($ql - $lw) / 2), (($ql - $lh) / 2), 0, 0, $lw, $lh, $w, $h);

examples/svgMeltedModules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function collectModules(Closure $transform):array{
3838
$paths = [];
3939

4040
// collect the modules for each type
41-
foreach($this->matrix->matrix() as $y => $row){
41+
foreach($this->matrix->getMatrix() as $y => $row){
4242
foreach($row as $x => $M_TYPE){
4343
$M_TYPE_LAYER = $M_TYPE;
4444

examples/svgRandomColoredDots.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function collectModules(Closure $transform):array{
4141
$paths = [];
4242

4343
// collect the modules for each type
44-
foreach($this->matrix->matrix() as $y => $row){
44+
foreach($this->matrix->getMatrix() as $y => $row){
4545
foreach($row as $x => $M_TYPE){
4646
$M_TYPE_LAYER = $M_TYPE;
4747

examples/svgRoundQuietzone.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected function colorQuietzone(int $quietzoneSize, float $radius):void{
8787
// substract 1/2 stroke width and module radius from the circle radius to not cut off modules
8888
$r = ($radius - $this->options->circleRadius * 2);
8989

90-
foreach($this->matrix->matrix() as $y => $row){
90+
foreach($this->matrix->getMatrix() as $y => $row){
9191
foreach($row as $x => $value){
9292

9393
// skip anything that's not quiet zone
@@ -175,7 +175,7 @@ protected function collectModules(Closure $transform):array{
175175
$paths = [];
176176

177177
// collect the modules for each type
178-
foreach($this->matrix->matrix() as $y => $row){
178+
foreach($this->matrix->getMatrix() as $y => $row){
179179
foreach($row as $x => $M_TYPE){
180180
$M_TYPE_LAYER = $M_TYPE;
181181

src/Common/MaskPattern.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public static function getBestPattern(QRData $dataInterface):self{
116116
$penalties = [];
117117

118118
foreach(self::PATTERNS as $pattern){
119-
$matrix = $dataInterface->writeMatrix(new self($pattern))->matrix(true);
119+
$matrix = $dataInterface->writeMatrix(new self($pattern))->getMatrix(true);
120120
$penalty = 0;
121121

122122
for($level = 1; $level <= 4; $level++){

src/Data/QRMatrix.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function initFunctionalPatterns():self{
147147
*
148148
* @return int[][]|bool[][]
149149
*/
150-
public function matrix(bool $boolean = null):array{
150+
public function getMatrix(bool $boolean = null):array{
151151

152152
if(!$boolean){
153153
return $this->matrix;
@@ -169,21 +169,21 @@ public function matrix(bool $boolean = null):array{
169169
/**
170170
* Returns the current version number
171171
*/
172-
public function version():?Version{
172+
public function getVersion():?Version{
173173
return $this->version;
174174
}
175175

176176
/**
177177
* Returns the current ECC level
178178
*/
179-
public function eccLevel():?EccLevel{
179+
public function getEccLevel():?EccLevel{
180180
return $this->eccLevel;
181181
}
182182

183183
/**
184184
* Returns the current mask pattern
185185
*/
186-
public function maskPattern():?MaskPattern{
186+
public function getMaskPattern():?MaskPattern{
187187
return $this->maskPattern;
188188
}
189189

@@ -192,7 +192,7 @@ public function maskPattern():?MaskPattern{
192192
*
193193
* size = version * 4 + 17 [ + 2 * quietzone size]
194194
*/
195-
public function size():int{
195+
public function getSize():int{
196196
return $this->moduleCount;
197197
}
198198

src/Decoder/Decoder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ public function decode(LuminanceSourceInterface $source):DecoderResult{
7171
private function decodeMatrix(BitMatrix $matrix):DecoderResult{
7272
// Read raw codewords
7373
$rawCodewords = $matrix->readCodewords();
74-
$this->version = $matrix->version();
75-
$this->eccLevel = $matrix->eccLevel();
76-
$this->maskPattern = $matrix->maskPattern();
74+
$this->version = $matrix->getVersion();
75+
$this->eccLevel = $matrix->getEccLevel();
76+
$this->maskPattern = $matrix->getMaskPattern();
7777

7878
if($this->version === null || $this->eccLevel === null || $this->maskPattern === null){
7979
throw new QRCodeDecoderException('unable to read version or format info'); // @codeCoverageIgnore

src/Detector/AlignmentPatternFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private function centerFromEnd(array $stateCount, int $end):float{
223223
* @return float|null vertical center of alignment pattern, or null if not found
224224
*/
225225
private function crossCheckVertical(int $startI, int $centerJ, int $maxCount, int $originalStateCountTotal):?float{
226-
$maxI = $this->matrix->size();
226+
$maxI = $this->matrix->getSize();
227227
$stateCount = [];
228228
$stateCount[0] = 0;
229229
$stateCount[1] = 0;

src/Detector/Detector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private function calculateModuleSizeOneWay(FinderPattern $a, FinderPattern $b):f
124124
*/
125125
private function sizeOfBlackWhiteBlackRunBothWays(float $fromX, float $fromY, float $toX, float $toY):float{
126126
$result = $this->sizeOfBlackWhiteBlackRun((int)$fromX, (int)$fromY, (int)$toX, (int)$toY);
127-
$dimension = $this->matrix->size();
127+
$dimension = $this->matrix->getSize();
128128
// Now count other way -- don't run off image though of course
129129
$scale = 1.0;
130130
$otherToX = ($fromX - ($toX - $fromX));
@@ -278,7 +278,7 @@ private function findAlignmentInRegion(
278278
float $allowanceFactor
279279
):?AlignmentPattern{
280280
// Look for an alignment pattern (3 modules in size) around where it should be
281-
$dimension = $this->matrix->size();
281+
$dimension = $this->matrix->getSize();
282282
$allowance = (int)($allowanceFactor * $overallEstModuleSize);
283283
$alignmentAreaLeftX = max(0, ($estAlignmentX - $allowance));
284284
$alignmentAreaRightX = min(($dimension - 1), ($estAlignmentX + $allowance));

src/Detector/FinderPatternFinder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(BitMatrix $matrix){
4949
* @return \chillerlan\QRCode\Detector\FinderPattern[]
5050
*/
5151
public function find():array{
52-
$dimension = $this->matrix->size();
52+
$dimension = $this->matrix->getSize();
5353

5454
// We are looking for black/white/black/white/black modules in
5555
// 1:1:3:1:1 ratio; this tracks the number of such modules seen so far
@@ -286,7 +286,7 @@ private function crossCheckDiagonal(int $centerI, int $centerJ):bool{
286286
return false;
287287
}
288288

289-
$dimension = $this->matrix->size();
289+
$dimension = $this->matrix->getSize();
290290

291291
// Now also count down, right from center
292292
$i = 1;
@@ -331,7 +331,7 @@ private function crossCheckDiagonal(int $centerI, int $centerJ):bool{
331331
* @noinspection DuplicatedCode
332332
*/
333333
private function crossCheckVertical(int $startI, int $centerJ, int $maxCount, int $originalStateCountTotal):?float{
334-
$maxI = $this->matrix->size();
334+
$maxI = $this->matrix->getSize();
335335
$stateCount = $this->getCrossCheckStateCount();
336336

337337
// Start counting up from center
@@ -415,7 +415,7 @@ private function crossCheckVertical(int $startI, int $centerJ, int $maxCount, in
415415
* @noinspection DuplicatedCode
416416
*/
417417
private function crossCheckHorizontal(int $startJ, int $centerI, int $maxCount, int $originalStateCountTotal):?float{
418-
$maxJ = $this->matrix->size();
418+
$maxJ = $this->matrix->getSize();
419419
$stateCount = $this->getCrossCheckStateCount();
420420

421421
$j = $startJ;

0 commit comments

Comments
 (0)