:octocat: FinderPattern::$count: remove property getter in favor of asymmetric visibility

This commit is contained in:
smiley
2026-03-18 15:28:42 +01:00
parent a172310ae6
commit daa64e8073
2 changed files with 3 additions and 7 deletions
+1 -5
View File
@@ -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
*
+2 -2
View File
@@ -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();
}