diff --git a/examples/imageWithLogo.php b/examples/imageWithLogo.php index 7287697ed..fc7b49ff9 100644 --- a/examples/imageWithLogo.php +++ b/examples/imageWithLogo.php @@ -52,7 +52,7 @@ class QRImageWithLogo extends QRGdImage{ $lh = (($this->options->logoSpaceHeight - 2) * $this->options->scale); // get the qrcode size - $ql = ($this->matrix->size() * $this->options->scale); + $ql = ($this->matrix->getSize() * $this->options->scale); // scale the logo and copy it over. done! imagecopyresampled($this->image, $im, (($ql - $lw) / 2), (($ql - $lh) / 2), 0, 0, $lw, $lh, $w, $h); diff --git a/examples/svgMeltedModules.php b/examples/svgMeltedModules.php index ca9b7ae78..55c682bac 100644 --- a/examples/svgMeltedModules.php +++ b/examples/svgMeltedModules.php @@ -38,7 +38,7 @@ class MeltedSVGQRCodeOutput extends QRMarkupSVG{ $paths = []; // collect the modules for each type - foreach($this->matrix->matrix() as $y => $row){ + foreach($this->matrix->getMatrix() as $y => $row){ foreach($row as $x => $M_TYPE){ $M_TYPE_LAYER = $M_TYPE; diff --git a/examples/svgRandomColoredDots.php b/examples/svgRandomColoredDots.php index 984a46138..8cd423946 100644 --- a/examples/svgRandomColoredDots.php +++ b/examples/svgRandomColoredDots.php @@ -41,7 +41,7 @@ class RandomDotsSVGOutput extends QRMarkupSVG{ $paths = []; // collect the modules for each type - foreach($this->matrix->matrix() as $y => $row){ + foreach($this->matrix->getMatrix() as $y => $row){ foreach($row as $x => $M_TYPE){ $M_TYPE_LAYER = $M_TYPE; diff --git a/examples/svgRoundQuietzone.php b/examples/svgRoundQuietzone.php index dd65431fd..0722e411b 100644 --- a/examples/svgRoundQuietzone.php +++ b/examples/svgRoundQuietzone.php @@ -87,7 +87,7 @@ class RoundQuietzoneSVGoutput extends QRMarkupSVG{ // substract 1/2 stroke width and module radius from the circle radius to not cut off modules $r = ($radius - $this->options->circleRadius * 2); - foreach($this->matrix->matrix() as $y => $row){ + foreach($this->matrix->getMatrix() as $y => $row){ foreach($row as $x => $value){ // skip anything that's not quiet zone @@ -175,7 +175,7 @@ class RoundQuietzoneSVGoutput extends QRMarkupSVG{ $paths = []; // collect the modules for each type - foreach($this->matrix->matrix() as $y => $row){ + foreach($this->matrix->getMatrix() as $y => $row){ foreach($row as $x => $M_TYPE){ $M_TYPE_LAYER = $M_TYPE; diff --git a/src/Common/MaskPattern.php b/src/Common/MaskPattern.php index 99b3d809c..c02a5ad0b 100644 --- a/src/Common/MaskPattern.php +++ b/src/Common/MaskPattern.php @@ -116,7 +116,7 @@ final class MaskPattern{ $penalties = []; foreach(self::PATTERNS as $pattern){ - $matrix = $dataInterface->writeMatrix(new self($pattern))->matrix(true); + $matrix = $dataInterface->writeMatrix(new self($pattern))->getMatrix(true); $penalty = 0; for($level = 1; $level <= 4; $level++){ diff --git a/src/Data/QRMatrix.php b/src/Data/QRMatrix.php index 2e93b4469..124f06571 100755 --- a/src/Data/QRMatrix.php +++ b/src/Data/QRMatrix.php @@ -147,7 +147,7 @@ class QRMatrix{ * * @return int[][]|bool[][] */ - public function matrix(bool $boolean = null):array{ + public function getMatrix(bool $boolean = null):array{ if(!$boolean){ return $this->matrix; @@ -169,21 +169,21 @@ class QRMatrix{ /** * Returns the current version number */ - public function version():?Version{ + public function getVersion():?Version{ return $this->version; } /** * Returns the current ECC level */ - public function eccLevel():?EccLevel{ + public function getEccLevel():?EccLevel{ return $this->eccLevel; } /** * Returns the current mask pattern */ - public function maskPattern():?MaskPattern{ + public function getMaskPattern():?MaskPattern{ return $this->maskPattern; } @@ -192,7 +192,7 @@ class QRMatrix{ * * size = version * 4 + 17 [ + 2 * quietzone size] */ - public function size():int{ + public function getSize():int{ return $this->moduleCount; } diff --git a/src/Decoder/Decoder.php b/src/Decoder/Decoder.php index 6ffb9318b..63839da0c 100644 --- a/src/Decoder/Decoder.php +++ b/src/Decoder/Decoder.php @@ -71,9 +71,9 @@ final class Decoder{ private function decodeMatrix(BitMatrix $matrix):DecoderResult{ // Read raw codewords $rawCodewords = $matrix->readCodewords(); - $this->version = $matrix->version(); - $this->eccLevel = $matrix->eccLevel(); - $this->maskPattern = $matrix->maskPattern(); + $this->version = $matrix->getVersion(); + $this->eccLevel = $matrix->getEccLevel(); + $this->maskPattern = $matrix->getMaskPattern(); if($this->version === null || $this->eccLevel === null || $this->maskPattern === null){ throw new QRCodeDecoderException('unable to read version or format info'); // @codeCoverageIgnore diff --git a/src/Detector/AlignmentPatternFinder.php b/src/Detector/AlignmentPatternFinder.php index 8718aecc5..ca62c6f36 100644 --- a/src/Detector/AlignmentPatternFinder.php +++ b/src/Detector/AlignmentPatternFinder.php @@ -223,7 +223,7 @@ final class AlignmentPatternFinder{ * @return float|null vertical center of alignment pattern, or null if not found */ private function crossCheckVertical(int $startI, int $centerJ, int $maxCount, int $originalStateCountTotal):?float{ - $maxI = $this->matrix->size(); + $maxI = $this->matrix->getSize(); $stateCount = []; $stateCount[0] = 0; $stateCount[1] = 0; diff --git a/src/Detector/Detector.php b/src/Detector/Detector.php index d2f459d5f..7f73bdc88 100644 --- a/src/Detector/Detector.php +++ b/src/Detector/Detector.php @@ -124,7 +124,7 @@ final class Detector{ */ private function sizeOfBlackWhiteBlackRunBothWays(float $fromX, float $fromY, float $toX, float $toY):float{ $result = $this->sizeOfBlackWhiteBlackRun((int)$fromX, (int)$fromY, (int)$toX, (int)$toY); - $dimension = $this->matrix->size(); + $dimension = $this->matrix->getSize(); // Now count other way -- don't run off image though of course $scale = 1.0; $otherToX = ($fromX - ($toX - $fromX)); @@ -278,7 +278,7 @@ final class Detector{ float $allowanceFactor ):?AlignmentPattern{ // Look for an alignment pattern (3 modules in size) around where it should be - $dimension = $this->matrix->size(); + $dimension = $this->matrix->getSize(); $allowance = (int)($allowanceFactor * $overallEstModuleSize); $alignmentAreaLeftX = max(0, ($estAlignmentX - $allowance)); $alignmentAreaRightX = min(($dimension - 1), ($estAlignmentX + $allowance)); diff --git a/src/Detector/FinderPatternFinder.php b/src/Detector/FinderPatternFinder.php index 0221db6c6..fadc0d13e 100644 --- a/src/Detector/FinderPatternFinder.php +++ b/src/Detector/FinderPatternFinder.php @@ -49,7 +49,7 @@ final class FinderPatternFinder{ * @return \chillerlan\QRCode\Detector\FinderPattern[] */ public function find():array{ - $dimension = $this->matrix->size(); + $dimension = $this->matrix->getSize(); // We are looking for black/white/black/white/black modules in // 1:1:3:1:1 ratio; this tracks the number of such modules seen so far @@ -286,7 +286,7 @@ final class FinderPatternFinder{ return false; } - $dimension = $this->matrix->size(); + $dimension = $this->matrix->getSize(); // Now also count down, right from center $i = 1; @@ -331,7 +331,7 @@ final class FinderPatternFinder{ * @noinspection DuplicatedCode */ private function crossCheckVertical(int $startI, int $centerJ, int $maxCount, int $originalStateCountTotal):?float{ - $maxI = $this->matrix->size(); + $maxI = $this->matrix->getSize(); $stateCount = $this->getCrossCheckStateCount(); // Start counting up from center @@ -415,7 +415,7 @@ final class FinderPatternFinder{ * @noinspection DuplicatedCode */ private function crossCheckHorizontal(int $startJ, int $centerI, int $maxCount, int $originalStateCountTotal):?float{ - $maxJ = $this->matrix->size(); + $maxJ = $this->matrix->getSize(); $stateCount = $this->getCrossCheckStateCount(); $j = $startJ; diff --git a/src/Detector/GridSampler.php b/src/Detector/GridSampler.php index 6352d09b7..bf5b2b31c 100644 --- a/src/Detector/GridSampler.php +++ b/src/Detector/GridSampler.php @@ -48,7 +48,7 @@ final class GridSampler{ * @throws \chillerlan\QRCode\Detector\QRCodeDetectorException if an endpoint is lies outside the image boundaries */ private function checkAndNudgePoints(BitMatrix $matrix, array $points):void{ - $dimension = $matrix->size(); + $dimension = $matrix->getSize(); $nudged = true; $max = count($points); diff --git a/src/Output/QRFpdf.php b/src/Output/QRFpdf.php index 1ecabc540..e22a328f2 100644 --- a/src/Output/QRFpdf.php +++ b/src/Output/QRFpdf.php @@ -115,7 +115,7 @@ class QRFpdf extends QROutputAbstract{ $prevColor = null; - foreach($this->matrix->matrix() as $y => $row){ + foreach($this->matrix->getMatrix() as $y => $row){ foreach($row as $x => $M_TYPE){ diff --git a/src/Output/QRGdImage.php b/src/Output/QRGdImage.php index 0299ceb9f..78a317677 100644 --- a/src/Output/QRGdImage.php +++ b/src/Output/QRGdImage.php @@ -228,7 +228,7 @@ class QRGdImage extends QROutputAbstract{ * Creates the QR image */ protected function drawImage():void{ - foreach($this->matrix->matrix() as $y => $row){ + foreach($this->matrix->getMatrix() as $y => $row){ foreach($row as $x => $M_TYPE){ $this->setPixel($x, $y, $M_TYPE); } diff --git a/src/Output/QRImagick.php b/src/Output/QRImagick.php index d8203ce34..cf31e7773 100644 --- a/src/Output/QRImagick.php +++ b/src/Output/QRImagick.php @@ -186,7 +186,7 @@ class QRImagick extends QROutputAbstract{ $this->imagickDraw = new ImagickDraw; $this->imagickDraw->setStrokeWidth(0); - foreach($this->matrix->matrix() as $y => $row){ + foreach($this->matrix->getMatrix() as $y => $row){ foreach($row as $x => $M_TYPE){ $this->setPixel($x, $y, $M_TYPE); } diff --git a/src/Output/QRMarkupHTML.php b/src/Output/QRMarkupHTML.php index b85c09df2..9cb8dce77 100644 --- a/src/Output/QRMarkupHTML.php +++ b/src/Output/QRMarkupHTML.php @@ -27,7 +27,7 @@ class QRMarkupHTML extends QRMarkup{ $html .= $this->options->eol; - foreach($this->matrix->matrix() as $row){ + foreach($this->matrix->getMatrix() as $row){ $html .= '