diff --git a/src/Detector/FinderPattern.php b/src/Detector/FinderPattern.php index 8372956ca..86791b715 100644 --- a/src/Detector/FinderPattern.php +++ b/src/Detector/FinderPattern.php @@ -23,7 +23,7 @@ use function sqrt; */ final class FinderPattern extends ResultPoint{ - private int $count; + private(set) int $count; public function __construct(float $posX, float $posY, float $estimatedModuleSize, int|null $count = null){ parent::__construct($posX, $posY, $estimatedModuleSize); @@ -31,10 +31,6 @@ final class FinderPattern extends ResultPoint{ $this->count = ($count ?? 1); } - public function getCount():int{ - return $this->count; - } - /** * @param \chillerlan\QRCode\Detector\FinderPattern $b second pattern * diff --git a/src/Detector/FinderPatternFinder.php b/src/Detector/FinderPatternFinder.php index 0d5157588..12b478768 100644 --- a/src/Detector/FinderPatternFinder.php +++ b/src/Detector/FinderPatternFinder.php @@ -559,7 +559,7 @@ final class FinderPatternFinder{ foreach($this->possibleCenters as $center){ - if($center->getCount() >= self::CENTER_QUORUM){ + if($center->count >= self::CENTER_QUORUM){ if($firstConfirmedCenter === null){ $firstConfirmedCenter = $center; @@ -592,7 +592,7 @@ final class FinderPatternFinder{ $max = count($this->possibleCenters); foreach($this->possibleCenters as $pattern){ - if($pattern->getCount() >= self::CENTER_QUORUM){ + if($pattern->count >= self::CENTER_QUORUM){ $confirmedCount++; $totalModuleSize += $pattern->getEstimatedModuleSize(); }