From 714d029504187382ecb70d4d099bc7570369182c Mon Sep 17 00:00:00 2001 From: smiley Date: Mon, 29 Feb 2016 22:24:48 +0100 Subject: [PATCH] gonna leave it that way... --- src/Output/QRString.php | 2 +- src/QRCode.php | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Output/QRString.php b/src/Output/QRString.php index 940083474..c246ddfc9 100644 --- a/src/Output/QRString.php +++ b/src/Output/QRString.php @@ -11,7 +11,7 @@ */ namespace chillerlan\QRCode\Output; -use chillerlan\QRCode\Data\QRCodeDataException; + use chillerlan\QRCode\QRCode; /** diff --git a/src/QRCode.php b/src/QRCode.php index 0b1b69605..34d12ad75 100644 --- a/src/QRCode.php +++ b/src/QRCode.php @@ -83,7 +83,7 @@ class QRCode{ protected $darkCount; /** - * @var int + * @var float */ protected $minLostPoint; @@ -156,6 +156,7 @@ class QRCode{ break; } + // see, Scrunitizer, it is concrete! :P $qrDataInterface = [ QRConst::MODE_ALPHANUM => AlphaNum::class, QRConst::MODE_BYTE => Byte::class, @@ -348,14 +349,12 @@ class QRCode{ $this->lostPoint = 0; $this->darkCount = 0; - $range1 = range(0, $this->pixelCount-1); - $range2 = range(0, $this->pixelCount-2); - $range3 = range(0, $this->pixelCount-7); + $range = range(0, $this->pixelCount-1); - $this->testLevel1($range1); - $this->testLevel2($range2); - $this->testLevel3($range1, $range3); - $this->testLevel4($range1); + $this->testLevel1($range); + $this->testLevel2(range(0, $this->pixelCount-2)); + $this->testLevel3($range, range(0, $this->pixelCount-7)); + $this->testLevel4($range); $this->lostPoint += (abs(100 * $this->darkCount / $this->pixelCount / $this->pixelCount - 50) / 5) * 10;