Skip to content

Commit c0dba8d

Browse files
committed
:octocat: QROutputAbstract::getModuleValue() now throws if the value is not set
1 parent 99b1f9c commit c0dba8d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Output/QROutputAbstract.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,13 @@ protected function setModuleValues():void{
111111
/**
112112
* Returns the prepared value for the given $M_TYPE
113113
*
114-
* @return mixed|null return value depends on the output class, null if $moduleValues[$M_TYPE] doesn't exist
115-
* @throws \chillerlan\QRCode\Output\QRCodeOutputException
114+
* @return mixed return value depends on the output class
115+
* @throws \chillerlan\QRCode\Output\QRCodeOutputException if $moduleValues[$M_TYPE] doesn't exist
116116
*/
117117
protected function getModuleValue(int $M_TYPE){
118118

119119
if(!isset($this->moduleValues[$M_TYPE])){
120-
return null;
121-
# throw new QRCodeOutputException(sprintf('invalid M_TYPE: %024b', $M_TYPE));
120+
throw new QRCodeOutputException(sprintf('$M_TYPE %012b not found in module values map', $M_TYPE));
122121
}
123122

124123
return $this->moduleValues[$M_TYPE];

0 commit comments

Comments
 (0)