Browse Source

:octocat:

smiley 2 years ago
parent
commit
28b6e2c418

+ 2 - 2
examples/reader.php

@@ -15,8 +15,8 @@ require_once __DIR__.'/../vendor/autoload.php';
 // please excuse the IDE yelling https://youtrack.jetbrains.com/issue/WI-66549
 $options = new QROptions;
 $options->readerUseImagickIfAvailable = false;
-$options->readerGrayscale = true;
-$options->readerIncreaseContrast = true;
+$options->readerGrayscale             = true;
+$options->readerIncreaseContrast      = true;
 
 try{
 	$result = (new QRCode($options))->readFromFile(__DIR__.'/../.github/images/example_image.png');

+ 2 - 1
examples/svgMeltedModules.php

@@ -5,6 +5,7 @@
  * eliminate hairline antialias "cracks" that tend to appear when two SVG paths are exactly adjacent to each other.
  *
  * @see https://github.com/chillerlan/php-qrcode/issues/127
+ * @see ./shapes.svg
  */
 
 use chillerlan\QRCode\{QRCode, QROptions};
@@ -48,7 +49,7 @@ class MeltedSVGQRCodeOutput extends QRMarkupSVG{
 					$M_TYPE_LAYER = QRMatrix::M_DATA;
 
 					if($this->matrix->check($x, $y)){
-						$M_TYPE_LAYER |= QRMatrix::IS_DARK;
+						$M_TYPE_LAYER = QRMatrix::M_DATA_DARK;
 					}
 				}
 

+ 1 - 1
examples/svgRandomColoredDots.php

@@ -53,7 +53,7 @@ class RandomDotsSVGOutput extends QRMarkupSVG{
 					$M_TYPE_LAYER = QRMatrix::M_DATA;
 
 					if($this->matrix->check($x, $y)){
-						$M_TYPE_LAYER |= QRMatrix::IS_DARK;
+						$M_TYPE_LAYER = QRMatrix::M_DATA_DARK;
 					}
 				}
 

+ 3 - 3
examples/svgRoundQuietzone.php

@@ -44,7 +44,7 @@ class RoundQuietzoneSVGoutput extends QRMarkupSVG{
 		$this->colorQuietzone($quietzoneSize, ($diameter / 2));
 
 		// calculate the logo space
-		$logoSpaceSize = (int)ceil($this->moduleCount * $this->options->svgLogoScale);
+		$logoSpaceSize = (int)(ceil($this->moduleCount * $this->options->svgLogoScale) + 1);
 		// we're calling QRMatrix::setLogoSpace() manually, so QROptions::$addLogoSpace has no effect here
 		$this->matrix->setLogoSpace($logoSpaceSize);
 
@@ -185,7 +185,7 @@ class RoundQuietzoneSVGoutput extends QRMarkupSVG{
 					$M_TYPE_LAYER = QRMatrix::M_DATA;
 
 					if($this->matrix->check($x, $y)){
-						$M_TYPE_LAYER |= QRMatrix::IS_DARK;
+						$M_TYPE_LAYER = QRMatrix::M_DATA_DARK;
 					}
 				}
 
@@ -335,7 +335,7 @@ $options = new RoundQuietzoneOptions([
 		QRMatrix::M_FINDER_DARK,
 		QRMatrix::M_FINDER_DOT,
 		QRMatrix::M_ALIGNMENT_DARK,
-		(QRMatrix::M_QUIETZONE | QRMatrix::IS_DARK),
+		QRMatrix::M_QUIETZONE_DARK,
 	],
 	'drawCircularModules' => true,
 	'circleRadius'        => 0.4,

+ 2 - 1
src/Output/QRMarkup.php

@@ -87,7 +87,8 @@ abstract class QRMarkup extends QROutputAbstract{
 	}
 
 	/**
-	 *
+	 * returns the fully parsed and rendered markup string for the given input
 	 */
 	abstract protected function createMarkup(bool $saveToFile):string;
+
 }

+ 1 - 1
src/Output/QROutputAbstract.php

@@ -187,7 +187,7 @@ abstract class QROutputAbstract implements QROutputInterface{
 					$M_TYPE_LAYER = QRMatrix::M_DATA;
 
 					if($this->matrix->check($x, $y)){
-						$M_TYPE_LAYER |= QRMatrix::IS_DARK;
+						$M_TYPE_LAYER = QRMatrix::M_DATA_DARK;
 					}
 				}
 

+ 1 - 1
tests/Data/QRMatrixTest.php

@@ -176,7 +176,7 @@ final class QRMatrixTest extends TestCase{
 	public static function matrixProvider():Generator{
 		$ecc = new EccLevel(EccLevel::L);
 
-		foreach(range(1, 40) as $i){
+		for($i = 1; $i <= 40; $i++){
 			yield 'version: '.$i => [new QRMatrix(new Version($i), $ecc)];
 		}
 	}