codemasher 5 лет назад
Родитель
Сommit
4167286f65
2 измененных файлов с 8 добавлено и 1 удалено
  1. 7 0
      src/Common/EccLevel.php
  2. 1 1
      src/Data/QRMatrix.php

+ 7 - 0
src/Common/EccLevel.php

@@ -213,6 +213,13 @@ final class EccLevel{
 		$this->eccLevel = $eccLevel;
 	}
 
+	/**
+	 * returns the current ECC level
+	 */
+	public function getLevel():int{
+		return $this->eccLevel;
+	}
+
 	/**
 	 * returns the ordinal value of the current ECC level
 	 */

+ 1 - 1
src/Data/QRMatrix.php

@@ -438,7 +438,7 @@ final class QRMatrix{
 	public function setLogoSpace(int $width, int $height, int $startX = null, int $startY = null):QRMatrix{
 
 		// for logos we operate in ECC H (30%) only
-		if($this->eccLevel->getOrdinal() !== EccLevel::H){
+		if($this->eccLevel->getLevel() !== EccLevel::H){
 			throw new QRCodeDataException('ECC level "H" required to add logo space');
 		}