소스 검색

:octocat:

smiley 2 년 전
부모
커밋
94becce830
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      src/Output/QROutputAbstract.php

+ 9 - 2
src/Output/QROutputAbstract.php

@@ -94,10 +94,17 @@ abstract class QROutputAbstract implements QROutputInterface{
 	/**
 	 * Returns the prepared value for the given $M_TYPE
 	 *
-	 * @return mixed|null return value depends on the output class
+	 * @return mixed|null return value depends on the output class, null if $moduleValues[$M_TYPE] doesn't exist
+	 * @throws \chillerlan\QRCode\Output\QRCodeOutputException
 	 */
 	protected function getModuleValue(int $M_TYPE){
-		return ($this->moduleValues[$M_TYPE] ?? null);
+
+		if(!isset($this->moduleValues[$M_TYPE])){
+			return null;
+#			throw new QRCodeOutputException(sprintf('invalid M_TYPE: %024b', $M_TYPE));
+		}
+
+		return $this->moduleValues[$M_TYPE];
 	}
 
 	/**