mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-28 11:07:25 +00:00
:octocat: FinderPattern::$count: remove property getter in favor of asymmetric visibility
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user