Преглед изворни кода

:octocat: simplify logo space determination

smiley пре 2 година
родитељ
комит
1a0208a3e8
1 измењених фајлова са 2 додато и 7 уклоњено
  1. 2 7
      src/QRCode.php

+ 2 - 7
src/QRCode.php

@@ -121,14 +121,9 @@ class QRCode{
 	protected function addMatrixModifications(QRMatrix $matrix):QRMatrix{
 
 		if($this->options->addLogoSpace){
-			$logoSpaceWidth  = $this->options->logoSpaceWidth;
-			$logoSpaceHeight = $this->options->logoSpaceHeight;
-
 			// check whether one of the dimensions was omitted
-			if($logoSpaceWidth === null || $logoSpaceHeight === null){
-				$logoSpaceWidth  = ($logoSpaceWidth ?? $logoSpaceHeight ?? 0);
-				$logoSpaceHeight = null;
-			}
+			$logoSpaceWidth  = ($this->options->logoSpaceWidth ?? $this->options->logoSpaceHeight ?? 0);
+			$logoSpaceHeight = ($this->options->logoSpaceHeight ?? $logoSpaceWidth);
 
 			$matrix->setLogoSpace(
 				$logoSpaceWidth,